So say I had an array of $.post functions
var pa = [$.post(url0), $.post(url1),......];
$.when(pa[0],pa[1],...]) // works as expected
but
$.when.apply(pa) // does not work
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Function.prototype.applyrequires the context as first argument (the object which serves as reference forthis, in the called function)So you can call it like
I like to use a little “trickery” to avoid that every time. We can invoke
Function.prototype.bindlikenow, we indeed can call