This article illustrates the way in which jquery implements all AJAX requests for monitoring pages. Share to everyone for your reference, specific as follows:
Do you have a problem with a page that launches two AJAX requests and wants them to succeed and then do one more action?
The easy way to think of the solution is to wait for one of the ends and then start another one, which is done with a callback function.
However, if one of the AJAX request code is not you write, you can not change, how to do?
Or, you just want to know when a URL request to end, do not want to control other requests, how to do?
Other related functions:
In $.ajax:
Error: Called when an error occurs, can be used to escalate the wrong request.
Complete: Both success and failure will be invoked
In the high version:
$.promise
$.when
I hope this article will help you with the jquery program design.