I have to keep polling a server for informations, so I set this recursive function:
function getStats(){
$.getJSON("Stats", function(statList){
//parse the statList and update page's html
setTimeout(getStats(), 5000);//recalling
});
}
Looking at wireshark I see that the frequency is NOT every 5 seconds like it should! How come?
And while we are at it...this function is executed in a jquery tab, I'd like that when I change tab it just stops sending requests..how to do this too?