Can you stop JavaScript without blocking the browser? The way you usually stop execution is to do an endless while() -loop, but in the case of FireFox, it blocks the browser until the loop ends.
What are you doing this?
I am trying to override window.confirm() to implement my own dialog using HTML. I do this, so I do not need to change the existing code (this is a fairly large code base).
I need to be able to stop execution so that user input; in turn, returns a logical value similar to the standard confirmation function:
if (confirm("...")) { // user pressed "OK" } else { // user pressed "Cancel" }
Update
As far as I know; this cannot be done with setTimeout() or setInterval() , because these functions execute the asynchronous code assigned to them.
javascript execution
roosteronacid
source share