Ajax Error "Script7002:xmlhttprequest: Network error 0X2EF3, this operation could not be completed due to an error 00002EF3" summary

Source: Internet
Author: User

In the recent time to do the ASP, using AJAX to access the server data is sometimes inexplicably error:script7002:xmlhttprequest: Network error 0X2EF3, due to an error 00002EF3 cause this operation can not be completed . On-line check to cause this error is a very complex problem, that is, there are many factors will cause this AJAX error, the most painful is that after the AJAX error occurs, the server side will not back any status code and error messages, so can not directly track and determine exactly what caused the error. Here to write an article to do a summary, the known causes of errors summed up, if later know more reasons will continue to expand this article.

Reason one: Ajax contenttype Remember to add charset=utf-8, otherwise the approximate rate will cause Ajax error: script7002:xmlhttprequest: Network error 0X2EF3, due to error 00002EF3 This operation cannot be completed

If you are using an object such as jquery and XMLHttpRequest to make AJAX requests, set the contenttype of the AJAX request, and remember to add Charset=utf-8 to the ContentType. Otherwise, a large probability of SCRIPT7002 errors is thrown. If you use jquery's Ajax to send JSON data to the server, the correct way to send it is as follows:

1 varAjaxdata={};
2ajaxdata.year=2015;
3ajaxdata.month=11;
4ajaxdata.meesage= "Test Information";
5
6 $.ajax ({
7URL: "/home/getdata",
8 Data:JSON.stringify (Ajaxdata),
9Type: "POST",
TenContentType: "Application/json;charset=utf-8",//Remember to add charset=utf-8, otherwise AJAX requests may report SCRIPT7002 errors
OneSuccessfunction(Result) {
AAlert ("Request sent successfully!");
- },
-Errorfunction(Result) {
theAlert (result.status+ ":" +result.statustext);
- }
-});

reason two: Errors caused by keep-alive mechanism in IE

Ajax Error "Script7002:xmlhttprequest: Network error 0X2EF3, this operation could not be completed due to an error 00002EF3" summary

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.