2

重複の可能性:
Deferred の配列を $.when() に渡す

jquery deferred $.when を ajax 関数の配列として渡す方法はありますか? 例:

 var arr = [
    $.getJSON(window.location, function() { alert('yes') }),
    $.getJSON(window.location, function() { alert('yes') })
 ]

 $.when(arr).then(function(a, b) {

 });

ご協力いただきありがとうございます!

4

1 に答える 1

5
$.when.apply( $, arr ).then(function( a, b ) { ... });
于 2011-06-22T16:06:09.830 に答える