I have a script that does a Post Ajax from time to time.
update ();
$.ajax({
type: "POST",
url: "processar.php",
success: function(resposta){
$("#resposta").html(resposta);
$("#resposta").find("script").each(function(i) {
eval($(this).text());
});
},complete: function(){
setTimeout(function(){atualizar();},5000);
}
});
process.php
if( ($result->status=='OK'){
echo "<script>window.clearInterval(pisca['".$id_div."']);</script>";
}else{
echo "<script>pisca['".$id_div."'] = setInterval(function(){
$('#".$id_div."').animate({backgroundColor: 'white', color: 'black'}).delay(100);
$('#".$id_div."').animate({backgroundColor: '".$fundo."', color: '".$letra."'}).delay(100);
},100);</script>";
}
Step the div id by Post. But clearInterval does not work.
Any help?