色尼玛亚洲综合影院,亚洲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)系我們修改或刪除,多謝。

主站蜘蛛池模板: 沂南县| 隆昌县| 承德县| 吴旗县| 论坛| 会昌县| 弥勒县| 六盘水市| 茌平县| 牟定县| 福安市| 清河县| 龙里县| 万州区| 平湖市| 甘孜| 沂水县| 三河市| 宁都县| 麻江县| 三明市| 潜江市| 扶沟县| 万州区| 高州市| 荥经县| 崇信县| 宁夏| 琼海市| 南漳县| 嵊州市| 伊宁市| 镇巴县| 磐安县| 怀柔区| 钟祥市| 炉霍县| 澳门| 青阳县| 绵竹市| 五大连池市|