国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > JavaScript > 正文

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

2019-11-21 00:22:47
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
問(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.

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 渭南市| 苏尼特右旗| 望都县| 沂南县| 滕州市| 岗巴县| 太和县| 沾益县| 武安市| 曲周县| 治多县| 同仁县| 社会| 玛曲县| 疏勒县| 邯郸市| 成武县| 乌海市| 阳朔县| 江城| 青神县| 平泉县| 南川市| 和平县| 永寿县| 托克托县| 景德镇市| 绵阳市| 龙门县| 会昌县| 咸宁市| 鄢陵县| 马山县| 米泉市| 济宁市| 邻水| 凤山县| 渝北区| 云龙县| 东辽县| 鄱阳县|