Last active
November 3, 2015 08:52
-
-
Save VITIMan/c984fa7ff7f44cd2736c to your computer and use it in GitHub Desktop.
Jquery :: Wait until all requests are done
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var requests = []; | |
Object.keys(sources).forEach(function(key){ | |
requests.push(someAjaxAsyncRequest(arguments)); | |
}); | |
$.when.apply($, requests).done(function() { | |
console.log(arguments); | |
$.each(arguments, function (i, data) { | |
// By method | |
console.log(data); | |
}); | |
// For every function | |
$("#retry-request").prop('disabled', false); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment