Jquery Ajax BUG: object doesn "T support this property or Method

Source: Internet
Author: User

Problem: a bug in the jquery Control
When $. Ajax is used, an error occurs only in IE7. IE6 and IE8 are normal. The error message is as follows:

Description on the official forum:

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

Solution:
Modify jquery-1.4.2.js.

I have tested the modification method proposed on the forum.

CopyCode The Code is as follows: 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.