jquery Programming Glossary: numofajaxrequests
Trigger a function only after the completion of multiple AJAX requests http://stackoverflow.com/questions/3405218/trigger-a-function-only-after-the-completion-of-multiple-ajax-requests some tracking counting variables var ajaxDoneCounter 0 var numOfAjaxRequests 5 var workDone false function doWorkTrigger ajaxDoneCounter.. doWorkTrigger ajaxDoneCounter if workDone ajaxDoneCounter numOfAjaxRequests workDone true doWork ... and a number of ajax requests some.. whenever an Ajax call completed success or error var numOfAjaxRequests 5 document .ajaxComplete function numOfAjaxRequests if numOfAjaxRequests..
Trigger a function only after the completion of multiple AJAX requests http://stackoverflow.com/questions/3405218/trigger-a-function-only-after-the-completion-of-multiple-ajax-requests This is the function to be run once after all the requests some tracking counting variables var ajaxDoneCounter 0 var numOfAjaxRequests 5 var workDone false function doWorkTrigger ajaxDoneCounter if workDone ajaxDoneCounter numOfAjaxRequests workDone true.. 0 var numOfAjaxRequests 5 var workDone false function doWorkTrigger ajaxDoneCounter if workDone ajaxDoneCounter numOfAjaxRequests workDone true doWork ... and a number of ajax requests some hidden within functions etc they look something like this .ajax.. an example here . I would use .ajaxComplete it will be triggered whenever an Ajax call completed success or error var numOfAjaxRequests 5 document .ajaxComplete function numOfAjaxRequests if numOfAjaxRequests doWork Then you don't have to edit every Ajax..
|