I have already searched and did not find exactly what I want.
My problem is this: I have a comment page that I wanted it to be updated with every change in the bank (this is for everyone who is currently logged in).
I found some methods on the WEB that used setTimeOut()
to stay updated, but I did not really like the result ....
My AJAX to list is like this:
$(document).ready(function(){
$('#tabela').empty();
$.ajax({
type:'POST',
dataType: 'json',
url: 'system/getMessages.php',
success: function(dados){
for(var i=0;dados.length>i;i++){
$('#tabela').append('<tr><td><span>'+dados[i].username+'</span><br />'+dados[i].mensagem+'</td></tr>');
}
}
});
});
Before this same code was in a function that was using the method I quoted earlier (with JavaScript updates)
How can I do this?