>>345
https://api.jquery.com/jquery.when/

> $.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
> .then( myFunc, myFailure );


https://www.tam-tam.co.jp/tipsnote/javascript/post5807.html

> 「複数の非同期処理が全部終わったら、続く処理を行う」というのがすっきり書けます。
>
> $.when(
>   $.getJSON('a.json'),
>   $.getJSON('b.json')
> )
> .done(function(data_a, data_b) {
>   // すべて成功した時の処理
>   console.log(data_a, data_b);
> })
> .fail(function() {
>   // エラーがあった時
>   console.log('error');
> });