我現在只是在我的ASP.net網頁(實際上是Site.Master文件)中包含了jQuery(1.9.1,但舊的1.8.3表現方式相同)。一切工作正常在IE9/Win7-64下運行,但自從我升級到IE10(仍然Win7-64),現在當我在本地運行網頁,選擇Internet Explorer並從Visual Studio中運行時,我遇到了異常。在IE10/Win7上運行jQuery崩潰
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。我在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行? – 2013-02-28 20:36:32
我將對話框中的異常複製到我的問題中,參見上文。 – 2013-02-28 21:08:04
根據jQuery團隊的說法,這很好,因爲它是預期的。他們在更高層次上發現異常並自行處理。跛腳,但這是情況 – 2013-07-11 12:24:08