4
I am developing applications using jQuery/Ajax and it has to refresh page 5 in 5 seconds, it works. But if I start using the application the browser starts crashing because of the code, how to fix this problem?
Follows the code:
<script>
$(document).ready(function() {
agenda();
});
function agenda() {
$.post('cadastrados_compromiso.php', {
mes2: "<?php echo $mes2; ?>",
mes: "<?php echo $mes; ?>",
ano: "<?php echo $ano; ?>",
dia: "<?php echo $dia; ?>",
semana: "<?php echo $semana; ?>",
agenda: "<?php echo $agenda; ?>",
login: "<?php echo $login; ?>"
}, function(resposta) {
$("#mudaragenda").html(resposta);
var myVar = setInterval(function(){agenda()},5000);
}, 'html');
}
</script>
It crashes all browsers, I think it starts bugging because it’s very little update time and the browser can’t handle (?)...
Valew, it worked!!!
– Alan PS