Kryptix Posted February 16, 2010 Share Posted February 16, 2010 I want to update the user online count every second, how would I run a timer within JS/Ajax? Link to comment https://forums.phpfreaks.com/topic/192287-timer/ Share on other sites More sharing options...
trq Posted February 17, 2010 Share Posted February 17, 2010 setInterval(function() { // code }, 1); Link to comment https://forums.phpfreaks.com/topic/192287-timer/#findComment-1013584 Share on other sites More sharing options...
Kryptix Posted February 17, 2010 Author Share Posted February 17, 2010 Thank-you. Link to comment https://forums.phpfreaks.com/topic/192287-timer/#findComment-1013704 Share on other sites More sharing options...
isedeasy Posted February 19, 2010 Share Posted February 19, 2010 Just to warn you, the above code will run every millisecond (not good). Change the 1 to 1000 for 1 second. Link to comment https://forums.phpfreaks.com/topic/192287-timer/#findComment-1014897 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.