日期:2014-05-16  浏览次数:20379 次

JS在本地测试所有浏览器正常,服务器就报错。【急】
报错:
网页错误详细信息

用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; InfoPath.2)
时间戳: Tue, 23 Nov 2010 02:27:10 UTC


消息: 'current.style' 为空或不是对象
行: 56
字符: 5
代码: 0



前台:
C# code

<div id="index-splash-block" class="index-splash-block">
                        <div id="feature-slide-block" class="feature-slide-block">
                            <asp:Repeater ID="rep_prod1" runat="server" EnableTheming="true" EnableViewState="false">
                                <ItemTemplate>
                                    <div class="feature-slide-preview" style="display: none;">
                                        <img src='uploads/Image/<%# DataBinder.Eval(Container, "DataItem.TitlePicUrl") %>'
                                            width="230" height="220" alt="" />
                                    </div>
                                </ItemTemplate>
                            </asp:Repeater>
                            <div id="feature-slide-list" class="feature-slide-list">
                                <a href="#" id="feature-slide-list-previous" class="feature-slide-list-previous"></a>
                                <div id="feature-slide-list-items" class="feature-slide-list-items">
                                </div>
                                <a href="#" id="feature-slide-list-next" class="feature-slide-list-next"></a>
                            </div>
                        </div>

                        <script type="text/javascript">
                            initFeatureSlide();
                        </script>



JS如下:
JScript code
 
function initFeatureSlide(strId) {
    var domRoot = document.getElementById('feature-slide-block');
    if (!domRoot) return;
    domRoot.list = [];
    var children = domRoot.childNodes;
    var offset = 0;
    for (var i in children) {
        var domItem = children[i];
        if (domItem && domItem.className == 'feature-slide-preview') {
            domRoot.list.push(domItem);
            domItem.offset = offset;
            offset++;
        }
    }
    var domList = document.getElementById('feature-slide-list-items');
    if (!domList) return;
    domList.innerHTML = '';
    domList.items = [];
    for (var i = 0; i < domRoot.list.length; i++) {
        var temp = domRoot.list[i];
        var domItem = document.createElement('a');
        domList.appendChild(domItem);
        domItem.href = '#';
        domItem.onclick = function(){
            return false;
        }
        domList.items.push(domItem);
        domItem.offset = i;
    }
  &nb