5
I’ve looked and I haven’t found exactly what I want.
My problem is this: I have a comments page that I wanted to update every change in the bank (this for everyone who is connected at that time).
I found some methods on the web that used setTimeOut()
to keep updating, but not really liked 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 cited earlier (with Javascript updates)
How can I do this?