1

I'm trying to do a bunch of ajax requests but I need them to run one at a time. The below only seems to work on the first object and I think it's because it's trying to run everything at the one time.

$(fullurllist).each(function(index,element){
    runAjax(element.url)    
})
function runAjax(dataURL){
    $.ajax({
        url:dataURL,
        method: "GET",
        headers: { "Accept":  "application/json; odata=verbose"  },
        success: function  (data) {}
    })
}
Frank
  • 269
  • 1
  • 2
  • 8
  • This question has been asked and answered.... Here's an example: https://stackoverflow.com/questions/16384841/chain-ajax-and-execute-it-in-sequence-jquery-deferred – random_user_name Jul 12 '19 at 03:15
  • 3
    Possible duplicate of [Chain ajax and execute it in sequence. Jquery Deferred](https://stackoverflow.com/questions/16384841/chain-ajax-and-execute-it-in-sequence-jquery-deferred) – random_user_name Jul 12 '19 at 03:15

0 Answers0