I know both ie and firefox have limits for javascript execution (Source 1, Source 2). Based on number of statements executed, I heard it was 5 million somewhere in IE and ba
The event handler is considered a new execution context - the time limit is reset.
If you need to do even more computation, take a look at WebWorkers.