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