Execute function after Ajax call is complete

后端 未结 6 2029
遇见更好的自我
遇见更好的自我 2020-11-30 03:16

I am new to Ajax and I am attempting to use Ajax while using a for loop. After the Ajax call I am running a function that uses the variables created in the Ajax call. The fu

6条回答
  •  迷失自我
    2020-11-30 03:29

    Append .done() to your ajax request.

    $.ajax({
      url: "test.html",
      context: document.body
    }).done(function() { //use this
      alert("DONE!");
    });
    

    See the JQuery Doc for .done()

提交回复
热议问题