setTimeout()
, what happens is that the loop is executed on time, and every time 10 seconds (as I have determined in setTimeout()
) a function is executed ..
But if I want to abort all functions (which have already been called, they are only waiting for the time to execute, as I determined in setTimeout
), what could I do?
My code is + - like this:
$("array").each(function(i){
setTimeout(function(){
$.ajax({..});
},5000*i);
});