Geeky (and non-geeky) ramblings.

Javascript setInterval() issues

I decided to use AJAX calls to get the browser to make keep-alive calls every 2 minutes (using setInterval) and somehow stumbled into an issue where it makes the call once, and then stops. After talking the Javascript and Flash god in the office, we found out that it was because the script goes out of scope and thus stops looping as it should.

A quick fix for this can be found here. It’s been working for me without any adverse effects since. ;)

Save to del.icio.us:Javascript setInterval() issues Digg this:Javascript setInterval() issues Submit to Newsvine:Javascript setInterval() issues Blink this:Javascript setInterval() issues Submit to reddit:Javascript setInterval() issues Y!:Javascript setInterval() issues gifttagging:Javascript setInterval() issues