jQuery ajax BUG:object doesn't support this property or method
使用$.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。
論壇上有人提出的修改方式,我測試過可行。
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.
- jQuery 1.9移除了$.browser可以使用$.support來替代
- jQuery 1.9使用$.support替代$.browser的使用方法
- jQuery 源碼分析筆記(5) jQuery.support
- jQuery下通過$.browser來判斷瀏覽器.
- js/jquery獲取瀏覽器窗口可視區(qū)域高度和寬度以及滾動條高度實現(xiàn)代碼
- jquery判斷瀏覽器類型的代碼
- 兩種方法基于jQuery實現(xiàn)IE瀏覽器兼容placeholder效果
- js/jquery判斷瀏覽器的方法小結(jié)
- jQuery一步一步實現(xiàn)跨瀏覽器的可編輯表格,支持IE、Firefox、Safari、Chrome、Opera
- 源碼解讀jQ中瀏覽器兼容模塊support
相關(guān)文章
jquery調(diào)用wcf并展示出數(shù)據(jù)的方法
網(wǎng)上看了很多jquery調(diào)用wcf的例子,可能是主機的原因,我用的是gd主機,所以都沒有成功,昨天自己搞了一天,終于成功了,現(xiàn)把方法和代碼和大家分享2011-07-07
jQuery實現(xiàn)的手機發(fā)送驗證碼倒計時效果代碼分享
這篇文章主要為大家詳細介紹了jQuery實現(xiàn)手機注冊發(fā)送驗證碼倒計時功能,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2015-08-08
jQuery獲取table下某一行某一列的值實現(xiàn)代碼
這篇文章主要介紹了jQuery獲取table下某一行某一列的值實現(xiàn)代碼的相關(guān)資料,需要的朋友可以參考下2017-04-04
Jquery之Bind方法參數(shù)傳遞與接收的三種方法
這篇文章主要介紹了Jquery的Bind方法參數(shù)傳遞與接收的三種方法,需要的朋友可以參考下2014-06-06
淺談$(''div a'') 與$(''div>a'')的區(qū)別
下面小編就為大家?guī)硪黄獪\談$('div a') 與$('div>a')的區(qū)別。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-07-07

