Im trying to execute a function after 6 ajax calls (indluding the ".done" part after each one)
function showReports(array_monitor){
$.ajax({
method: "GET",
url: array_monitor[0],
datatype: "text",
}).done(function(xml) {
monitorName = array_monitor[1];
convert(xml, monitorName);
});
};
I have tried with $.when but it seems that is not working as I wanted
Edit:
I've included a global counter and the function after all the calls have to compress some files that are created, is it neccesary to set a timeout to wait or is $.when enough?
function zipAll(){
$.ajax({
method: "POST",
url: "zipAll.php",
}).done(function(){
window.location = "uptimeReports.zip";
console.log("hola");
});
}