I have a few ajax running on my sites simultaneously with setInterval, and there are some with buttons,
so for example if I want to check if this was finished, before I run it again. cause everytime I scroll to the bottom I run this. What is the best way to know that It should not call this, will still it still running.
$.post(base_url+"index.php/contracts/getleftpanedocs", {},
function(data){
if(data.count > 0){
$("#spandocdisplaycount").html(data.count);
$("#divdocsdisplay").fadeIn("slow");
}else{
$("#spandocdisplaycount").html(data.count);
$("#divdocsdisplay").fadeOut("slow");
}
},"json");
You can probably set a flag
something like that might work!