jQuery ajax BUG:object doesn't support this property or method
使用$.ajax時(shí)出現(xiàn)的錯(cuò)誤,IE7下才會(huì)出錯(cuò),IE6,IE8都正常。錯(cuò)誤提示如下圖:

官方論壇上的說明:
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ū)域高度和寬度以及滾動(dòng)條高度實(shí)現(xiàn)代碼
- jquery判斷瀏覽器類型的代碼
- 兩種方法基于jQuery實(shí)現(xiàn)IE瀏覽器兼容placeholder效果
- js/jquery判斷瀏覽器的方法小結(jié)
- jQuery一步一步實(shí)現(xiàn)跨瀏覽器的可編輯表格,支持IE、Firefox、Safari、Chrome、Opera
- 源碼解讀jQ中瀏覽器兼容模塊support
相關(guān)文章
自編jQuery插件實(shí)現(xiàn)模擬alert和confirm
現(xiàn)在絕大多數(shù)網(wǎng)站都不用自帶的alert和confirm了,因?yàn)榻缑嫣擦?。因此這個(gè)插件就這樣產(chǎn)生了...2014-09-09jQuery實(shí)現(xiàn)的簡單百分比進(jìn)度條效果示例
這篇文章主要介紹了jQuery實(shí)現(xiàn)的簡單百分比進(jìn)度條效果,結(jié)合簡單實(shí)例形式分析了jQuery針對(duì)頁面元素的運(yùn)算與動(dòng)態(tài)操作相關(guān)操作技巧,需要的朋友可以參考下2016-08-08非常實(shí)用的jQuery代碼段集錦【檢測瀏覽器、滾動(dòng)、復(fù)制、淡入淡出等】
這篇文章主要介紹了非常實(shí)用的jQuery代碼段集錦,總結(jié)分析了包括jQuery檢測瀏覽器、滾動(dòng)、復(fù)制、粘貼、淡入淡出等操作實(shí)現(xiàn)技巧,需要的朋友可以參考下2019-08-08jquery移動(dòng)點(diǎn)擊的項(xiàng)目到列表最頂端的方法
這篇文章主要介紹了jquery移動(dòng)點(diǎn)擊的項(xiàng)目到列表最頂端的方法,涉及jQuery針對(duì)頁面元素的操作技巧,需要的朋友可以參考下2015-06-06基于jQuery實(shí)現(xiàn)復(fù)選框是否選中進(jìn)行答題提示
近期有項(xiàng)目需求是這樣的,需要根據(jù)用戶選擇的選項(xiàng)給出相應(yīng)的提示,本文給大家介紹基于jQuery實(shí)現(xiàn)復(fù)選框是否選中進(jìn)行答題提示,對(duì)jquery復(fù)選框是否選中相關(guān)知識(shí)感興趣的朋友一起看看吧2015-12-12jquery UI Datepicker時(shí)間控件的使用方法(終結(jié)版)
這篇文章是jquery UI Datepicker時(shí)間控件的使用方法終結(jié)版,可以說是技術(shù)的升華,實(shí)現(xiàn)的功能有限制的開始時(shí)間和結(jié)束時(shí)間跨度不超過三天,并配置有清空時(shí)間,重選時(shí)間等,感興趣的小伙伴們可以參考一下2015-11-11jQuery 導(dǎo)航自動(dòng)跟隨滾動(dòng)的實(shí)現(xiàn)代碼
這篇文章主要介紹了jQuery 導(dǎo)航自動(dòng)跟隨滾動(dòng)的實(shí)現(xiàn)代碼,需要的朋友可以參考下2018-05-05-
最新評(píng)論