function deployAddRecs(){
for (let i = 0; i < vanArr.length; i++){
addRecAjax.push(
$.get(url, {
act: "API_AddRecord",
_fid_8: "Unplugged",
_fid_10: vanArr[i]
})
);
}
$.when(addRecAjax).done(function(){
window.location.reload();
});
}
Hey everyone, I'm having a very frustrating problem ensuring all of the ajax requests in my array are completed before proceeding.
From the code snippet provided above, I am utilizing a database's API to add records to a table with specific information in the record. From my understanding of the documentation, the callback function is executed in .done() once all the requests in the array are successful.
However, the page is reloading prior to requests being completed, because from observation the page reloads before all records are added. Any help would be amazing.