Home  >  Article  >  Web Front-end  >  Ajax issues in JQuery 1.4_jquery

Ajax issues in JQuery 1.4_jquery

WBOY
WBOYOriginal
2016-05-16 18:35:581280browse

When using $.ajax(), I set the timeout to 3 seconds:

Copy code The code is as follows:

$.ajax({
url: "ajaxTable1.aspx",
cache: false,
error: function(XMLHttpRequest, textStatus, errorThrown) {
//
} ,
success: function(html) {
//
},
timeout: 3000
});

ajaxTable1.aspx page I pass Thread .Sleep(1000 * 5); causes the page to delay execution for 5 seconds before continuing, so the ajax request will time out, but at this moment it will report "Error: The object does not support this operation". I thought there was something wrong with my script at first, but I spent a long time looking for it. No errors were found. Finally, after changing to JQuery-1.3.1, the errors disappeared and the code ran normally. It seems that the new version is not stable yet.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn