How do I make a function wait until all jQuery Ajax requests are done inside another function?
In short, I need to wait for all Ajax requests to be done before I exe
If you need something simple; once and done callback
//multiple ajax calls above var callback = function () { if ($.active !== 0) { setTimeout(callback, '500'); return; } //whatever you need to do here //... }; callback();