我正在尝试使用 jQuery 的 when() 并传入 XHRRequest 的动态列表,但显然 when() 不支持数组作为其参数。
我该怎么做呢?
非常感谢任何帮助,谢谢!
最佳答案
这里的关键函数是apply() .
$.when.apply(null, arrayXHR).done(function(response1, response2, ....){
console.log(response1, response2 ...);
});
关于javascript - 如何在 jQuery when() 函数中传递 XHR 请求的动态列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15148070/