色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

jQuery ajax BUG:object doesn't support this property or method

問題:jQuery控件的一個BUG
使用$.ajax時出現(xiàn)的錯誤,IE7下才會出錯,IE6,IE8都正常。錯誤提示如下圖:

官方論壇上的說明:

http://forum.jquery.com/topic/object-doesn-t-support-this-property-or-method-from-jquery-1-4-1-in-ie7-only
http://dev.jquery.com/ticket/6498
http://dev.jquery.com/ticket/6314

解決方案:
修改jquery-1.4.2.js。

論壇上有人提出的修改方式,我測試過可行。
復(fù)制代碼 代碼如下:
Hi, I found this seems to relate to jQuery bug 6314 (http://dev.jquery.com/ticket/6314). In IE7, if "Enable native XMLHTTP support" is checked (under Tools > InterNET Options > Advanced tab > inside the security section) then this error shows up. Unchecking/disabiling the option seems to resolve the error.

However, since I cannot tell all website viewers to uncheck that option, then the following code also seems to resolve the issue:
In non-minified jQuery, find the lines:
try {
var oldAbort = xhr.abort;
xhr.abort = function() {
if ( xhr) {
oldAbort.call( xhr );
}

onreadystatechange( "abort" );
};
} catch(e) { }

replace it with the following code:
try {
var oldAbort = xhr.abort;
xhr.abort = function() {
if ( xhr) {
if (oldAbort.call === undefined) {
oldAbort();
} else {
oldAbort.call( xhr );
}
}

onreadystatechange( "abort" );
};
} catch(e) { }

I believe the issue is as stated by other users in this forum, that the xhr (XMLHTTP) object is a native IE object, so the abort function on the xhr.abort function does not support call.

JavaScript技術(shù)jQuery ajax BUG:object doesn't support this property or method,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 德州市| 阳西县| 鲁甸县| 时尚| 慈利县| 体育| 壶关县| 花莲县| 新干县| 孟津县| 芷江| 无棣县| 商洛市| 泰兴市| 抚州市| 衡南县| 吉木萨尔县| 深圳市| 天水市| 北流市| 库尔勒市| 南昌市| 烟台市| 涪陵区| 济阳县| 肥东县| 丹巴县| 凤阳县| 阿荣旗| 化德县| 巴南区| 锡林浩特市| 即墨市| 栾城县| 盐源县| 泸溪县| 大同市| 黄骅市| 札达县| 肥乡县| 格尔木市|