我目前只是在我的 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");
有人有什么想法吗?