In one HTML page I have a JavaScript function checkUpdates() that hits the server. I make this function run every 5 seconds with this line:
window.setInterval("checkUpdates()", 5 * 1000);
In Firebug, I put a breakpoint inside the checkUpdates() function. However, after the code execution stops at this breakpoint, pressing "continue" sometimes doesn't do anything. All the JavaScript on my page appears to have stopped.
Does this have something to do with the above line of code? Does the loop that executes checkUpdates() every 5 seconds pause when I am at a breakpoint, or does it continue running in the background? I wonder if waiting longer than the 5-second interval to press "continue" is what causes things to break.
Side note: I am new to Javascript and event-driven programming in general, so I am still a bit fuzzy on a few of the paradigms, such as whether code gets executed sequentially or concurrently. Any pointers to reading material on this would be appreciated.