I'm trying to use jQuery's when() and pass in a dynamic list of XHRRequests, but apparently when() does not support an array as its parameter.
How would I go about doing this?
I would really appreciate any help, thanks!
I'm trying to use jQuery's when() and pass in a dynamic list of XHRRequests, but apparently when() does not support an array as its parameter.
How would I go about doing this?
I would really appreciate any help, thanks!
The key function here is apply().
$.when.apply(null, arrayXHR).done(function(response1, response2, ....){
console.log(response1, response2 ...);
});