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

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

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

官方論壇上的說(shuō)明:

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。

論壇上有人提出的修改方式,我測(cè)試過(guò)可行。
復(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)載需保留來(lái)源!

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

主站蜘蛛池模板: 中阳县| 光山县| 建平县| 铜梁县| 连平县| 西畴县| 阿坝| 遵义市| 自治县| 习水县| 抚州市| 浙江省| 敦煌市| 南陵县| 荣昌县| 友谊县| 马尔康县| 海安县| 井冈山市| 张掖市| 方正县| 年辖:市辖区| 额敏县| 花莲市| 平武县| 宁强县| 石景山区| 乐亭县| 江川县| 罗平县| 太湖县| 蒙自县| 宝山区| 台山市| 高平市| 慈利县| 桐梓县| 合川市| 乡宁县| 星座| 九江市|