I have a very short question. What happen if I use setInterval method to call an ajax function like checking message in inbox every 3 second (or if I can do in every 1 second would be nice!)
Well this is what I use:
setInterval(function() {
chk_inbx (var1, var2);
}, 8000);
I call this function every 8 second right now. I see no problem. (or maybe I don´t have so many users right now)
But what happen if I change it from 8000 to 3000 or even 1000 ?
UPDATE I have test the polling (LONG POLLING (in php) starts hanging after 5 requests to database )
I wonder what ´s diferences between setTimeout and setTimeout with polling. What I understand is in php file they put the sleep(); function and use timestamp to determin if the data is old or not.
But mine, I use N nd Y to determine if msg is read or not. if N then show the rowCount.
So what is the different ? can anyone help me ?