-1

仅在 IE7 中,脚本错误消息会显示在状态栏中,这会削弱 UI。例如,如果我单击任何锚标记,它就不起作用。顺便说一句,这个脚本错误位置和调用堆栈是使用 IE7 的 Web 开发助手获取的。

如果我包含jquery-1.9.1.min.js,在 IE7 中我会看到以下脚本错误消息:

at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.min.js [4]
    wt
    code: if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t) at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.min.js [4]
    st
    code: return wt(e.replace(W,"$1"),t,n,r) at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.min.js [4]
    JScript anonymous function
    code: b.find(e,this[t],n) at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.min.js [3]
    JScript anonymous function
    code: return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e) at http://10.15.1.77:8080/mhs/3p/jquery-migrate-1.1.1.min.js [2]
    JScript anonymous function
    code: return t&&"string"==typeof t&&!e.isPlainObject(n)&&(o=y.exec(t))&&o[1]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(e.trim(t),n,!0),n,a):v.apply(this,arguments) at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.min.js [3]
    JScript anonymous function
    code: return new b.fn.init(e,t,r) at http://10.15.1.77:8080/mhs/nwtTools.js [124]
    JScript anonymous function
    code: $("#IPL a").click(function()  {
            self.dropdownTools.hide();
        }) at http://10.15.1.77:8080/mhs/nwtTools.js [10]
    JScript anonymous function
    code: this.attachEvents() at http://10.15.1.77:8080/mhs/nwtTools.js [270]
    JScript anonymous function
    code: var nwtTools = new NWTTools() at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.min.js [3]
    JScript anonymous function
    code: if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse) at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.min.js [3]
    JScript anonymous function
    code: return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.min.js [3]
    JScript anonymous function
    code: b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready")) at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.min.js [3]
    JScript anonymous function
    code: (o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())

如果我包含jquery-1.9.1.js,在 IE7 中我会看到以下脚本错误消息:

at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.js [5472]
    select
    code: context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0]
at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.js [3998]
    Sizzle
    code: return select( selector.replace( rtrim, "$1" ), context, results, seed )
at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.js [5576]
    JScript anonymous function
    code: jQuery.find( selector, this[ i ], ret )
at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.js [196]
    JScript anonymous function
    code: return ( context || rootjQuery ).find( selector )
at http://10.15.1.77:8080/mhs/3p/jquery-migrate-1.1.1.min.js [2]
    JScript anonymous function
    code: return t&&"string"==typeof t&&!e.isPlainObject(n)&&(o=y.exec(t))&&o[1]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(e.trim(t),n,!0),n,a):v.apply(this,arguments)
at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.js [62]
    JScript anonymous function
    code: return new jQuery.fn.init( selector, context, rootjQuery )
at http://10.15.1.77:8080/mhs/nwtTools.js [124]
    JScript anonymous function
    code: $("#IPL a").click(function()  {
            self.dropdownTools.hide();
        })
at http://10.15.1.77:8080/mhs/nwtTools.js [10]
    JScript anonymous function
    code: this.attachEvents()
at http://10.15.1.77:8080/mhs/nwtTools.js [270]
    JScript anonymous function
    code: var nwtTools = new NWTTools()
at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.js [1037]
    JScript anonymous function
    code: if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse )
at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.js [1148]
    JScript anonymous function
    code: fire( args )
at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.js [433]
    JScript anonymous function
    code: readyList.resolveWith( document, [ jQuery ] )
at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.js [103]
    JScript anonymous function
    code: jQuery.ready()
at http://10.15.1.77:8080/mhs/nwtTools.js [124]
    JScript anonymous function
    code: $("#IPL a").click(function()  {
            self.dropdownTools.hide();
        })
at http://10.15.1.77:8080/mhs/nwtTools.js [10]
    JScript anonymous function
    code: this.attachEvents()
at http://10.15.1.77:8080/mhs/nwtTools.js [270]
    JScript anonymous function
    code: var nwtTools = new NWTTools()
at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.js [1037]
    JScript anonymous function
    code: if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse )
at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.js [1148]
    JScript anonymous function
    code: fire( args )
at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.js [433]
    JScript anonymous function
    code: readyList.resolveWith( document, [ jQuery ] )
at http://10.15.1.77:8080/mhs/3p/jquery-1.9.1.js [103]
    JScript anonymous function
    code: jQuery.ready()
4

1 回答 1

2

我对 IE7 使用 jquery 1.7.2,对所有其他浏览器使用 jquery 1.9.1。它现在工作正常。感谢 SpYk3HH。

于 2013-04-26T00:26:22.737 回答