Wait until all jQuery Ajax requests are done?

后端 未结 21 1787
离开以前
离开以前 2020-11-21 04:39

How do I make a function wait until all jQuery Ajax requests are done inside another function?

In short, I need to wait for all Ajax requests to be done before I exe

21条回答
  •  一生所求
    2020-11-21 05:42

    This is working for me It's very simple

    return $.ajax({
      type: 'POST',
      url: urlBaseUrl
      data: {someData:someData},
      dataType: "json",
      success: function(resultData) { 
      }
    });
    

提交回复
热议问题