Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
08-21-2011, 11:20 PM #1
- Join Date
- Aug 2011
- Thanked 0 Times in 0 Posts
My apologies if this is not formatted correctly as I am on my phone and not everything displays correctly.
I am trying to write a class or function (not sure which is needed) that controls stats on my page. I currently have a working example but I need additional functionality and I'm not sure how to do it. Basically it needs to run every 6 seconds to update the stats(as they change constantly).
08-21-2011, 11:54 PM #2
just call your function that checks the database from within setInterval, something like
you may need to call the function that displays your stats again once the new ones come in (most likely from a callback function, to give the page time to load the new stats... although if you are constantly reloading the stats maybe you can get away without this and just have a lag), depending on how your code is set up
Last edited by xelawho; 08-21-2011 at 11:57 PM. Reason: forgot about callback, again