Pass in an array of Deferreds to $.when()

后端 未结 9 1258
伪装坚强ぢ
伪装坚强ぢ 2020-11-21 22:20

Here\'s an contrived example of what\'s going on: http://jsfiddle.net/adamjford/YNGcm/20/

HTML:

Click me!
&l
9条回答
  •  一个人的身影
    2020-11-21 22:35

    You can apply the when method to your array:

    var arr = [ /* Deferred objects */ ];
    
    $.when.apply($, arr);
    

    How do you work with an array of jQuery Deferreds?

提交回复
热议问题