Pause script execution


I’ve got a custom alert dialog box that i use instead of the alert() function, but the one thing that’s holding me up (not too much of a problem at the moment but i think it could in the future) is that, like the alert() function, i want to pause script execution until the user clicks “Okay”.

Is this possible?

You can’t.

The other code would need to be aware of the dialog being in an open state, and simply not do anything while that state is true. This could be complex or simple depending on your needs.

Not really. About the best you can do here is to investigate modal dialog box techniques.