Skip to content Skip to sidebar Skip to footer

Is There Something As "immediate Events" In Javascript?

Is the notion/concept of 'immediate events' something that exists in Javascript implementations? Background In this this answer to the question 'Is javascript guaranteed to be sing

Solution 1:

There is no thing as "immediate events" in Javascript, normally code will never be interrupted to handle events.

The case with modal popups like alert is the only exception. In some browsers the code in a method can be put "on hold" when you call alert, and there are events happening while the alert is open. Normally there would be no events that needed handling while the alert is open, but obviously you have found an exception.

Normally the "run-to-completion" principle is the rule. Unless you use something like alert or prompt, you can rely on the code being run uninterrupted until you exit your function. Actually nothing happens in the browser while the code is running; there are no page updates, not even GIF animations move while there is Javascript running.

Post a Comment for "Is There Something As "immediate Events" In Javascript?"