javascript - jquery : wait until all ajax calls finish then continue - Stack Overflow I do not like ...

Please Visit: http://ift.tt/1ajReyV



javascript - jquery : wait until all ajax calls finish then continue - Stack Overflow

I do not like any answer at all, the best way (since Jquery 1.5+) is to use Deferred objects, those are objects to manipulate async calls, you can solve :

$.when($.ajax("/page1.php"), $.ajax("/page2.php"))

.then(myFunc, myFailure);

This way myFunc executes after the 2 ajax calls are made, and myFailure if either one has an error.

You can read more about it in the jquery official documentation: (Link->http://ift.tt/1pSQ1uT)

http://ift.tt/1idrgly

http://ift.tt/1idrfOt



javascript - jquery : wait until all ajax calls finish then continue - Stack Overflow







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1pSQ1Lq

via LifeLong Community

No comments:

Post a Comment