포인트(?)는 ajax에서 return $.ajax()를 해주어야 한다는 것
$.when(ajax1(), ajax2(), ajax3(), ajax4()).done(function(a1, a2, a3, a4){ // the code here will be executed when all four ajax requests resolve. // a1, a2, a3 and a4 are lists of length 3 containing the response text, // status, and jqXHR object for each of the four ajax calls respectively. }); function ajax1() { // NOTE: This function must return the value // from calling the $.ajax() method. return $.ajax({ url: "someUrl", dataType: "json", data: yourJsonData, ... }); } |
[링크 : https://stackoverflow.com/questions/3709597/wait-until-all-jquery-ajax-requests-are-done]
'Programming > jquery' 카테고리의 다른 글
jquery selector와 document.getElementById 차이 (0) | 2018.11.05 |
---|---|
jquery trigger() (0) | 2018.10.25 |
jquery ajax data, header (0) | 2018.10.23 |
jquery shake (0) | 2018.10.16 |
jquery ani arc (0) | 2018.10.16 |