When all AJAX requests complete
问题 I have an ajax request that grabs some data and then splits it up into an array. The array length is variable. var ajax1 = $.ajax({ url: 'myurl.php', type: "GET", dataType: "jsonp", success: function (data) { //create an array } }); Once I have the array, I want to loop through it and in each iteration run another AJAX request. I put it inside a $.when to make sure the initial ajax request was complete: $.when(ajax1).done( function() { for (i = 0; i < array.length; ++i) { $.ajax({ url: