jquery Ajax timeout is not limited by default, what is the limit?

Source: Internet
Author: User

Usually when the Ajax access server, from the sending request to establish a connection, to the server processing and return the data time is not too long, depending on the server set session time. Once the server is processing data slowly and may time out, the AJAX client will need special handling to handle the response. Example:

$.ajax ({
URL: "Export-base!getzip.shtml",
Type: "Post",
Data: "Seid=${seid}",
Ansyc:false,
Success:function (data) {
Window.location.href = "";
}
});

Ajax does not set any time-out limits, and the server configuration returns a time-out page, then success data returns the HTML string for the time-out page. The experience is not good ....

Therefore, one way is to set the timeout time, for example, with the server-side timeout time, assuming timeout:30 minutes, and then the client to do the monitoring:
Complete:function (xmlhttprequest,status) {
if (status== ' timeout ') {alert ("Sorry, Request timed out");}
}

This is a lot of friendliness ...

jquery Ajax timeout is not limited by default, what is the limit?

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.