【发布时间】:2013-02-15 05:00:59
【问题描述】:
我目前只是在我的 ASP.net 网页(实际上是 Site.Master 文件)中包含 jQuery(1.9.1,但旧 1.8.3 的行为方式相同)。在 IE9/Win7-64 下运行一切正常,但自从我升级到 IE10(仍然是 Win7-64)后,现在当我在本地运行网页,选择 Internet Explorer 并从 Visual Studio 中运行时,我遇到了异常。
jquery-1.9.1.js 文件的第 4224 行出现异常。
// Opera 10-12/IE8 - ^= $= *= and empty values
// Should not select anything
div.innerHTML = "<input type='hidden' i=''/>";
if ( div.querySelectorAll("[i^='']").length ) {
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
}
// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
// IE8 throws error here and will not see later tests
if ( !div.querySelectorAll(":enabled").length ) {
rbuggyQSA.push( ":enabled", ":disabled" );
}
// Opera 10-11 does not throw on post-comma invalid pseudos
div.querySelectorAll("*,:x");
rbuggyQSA.push(",.*:");
jQuery,无论是旧的还是新的,似乎都不能正确处理 Windows 7 上的 IE10。我在 Opera 10-11 崩溃了,这很有趣。
我还看到 4242 发生崩溃
if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||
docElem.mozMatchesSelector ||
docElem.webkitMatchesSelector ||
docElem.oMatchesSelector ||
docElem.msMatchesSelector) )) ) {
assert(function( div ) {
// Check to see if it's possible to do matchesSelector
// on a disconnected node (IE 9)
support.disconnectedMatch = matches.call( div, "div" );
// This should fail with an exception
// Gecko does not error, returns false instead
matches.call( div, "[s!='']:x" );
rbuggyMatches.push( "!=", pseudos );
});
这是错误之一:
Exception was thrown at line 4224, column 4 in http://localhost:49928/jquery/jquery-1.9.1.js
0x800a139e - JavaScript runtime error: SyntaxError
Source line: div.querySelectorAll("*,:x");
有人有什么想法吗?
【问题讨论】:
-
有什么例外?您发布的代码中的第 4224 行是哪一行?
-
我将对话框中的异常复制到我的问题中,见上文。
-
根据 jQuery 团队的说法,这很好,因为它是预期的。他们在更高级别捕获异常并自行处理。蹩脚,但情况就是这样
标签: jquery asp.net windows-7 visual-studio-2012 internet-explorer-10