Do you mean executing one method after completing all the queries?
var counter = 0;
var nRequests = 3;
function multiSuccess() {
}
$('.button').click(function(){
$.post('file.php',{},function(){
counter++;
if(counter == nRequests) {
multiSuccess();
}
});
$.post(...
$.post(...
});
In addition, you can see ajaxStop:
Whenever an Ajax request completes, jQuery checks to see if there are any other outstanding Ajax requests. If none remain, jQuery fires an ajaxStop event. Any handlers that were registered in .ajaxStop () are executed at this time.
source
share