jQuery provides a way to handle this neatly:
$.when($.ajax( "/page1" ), $.ajax( "/page2" ) ).then(function( a1, a2)
{
// a1 and a2 are arguments resolved for the page1 and page2 ajax requests
// Each argument is an array with the following structure: [ data, statusText,jqXHR ]
});
{
// a1 and a2 are arguments resolved for the page1 and page2 ajax requests
// Each argument is an array with the following structure: [ data, statusText,jqXHR ]
});
No comments:
Post a Comment