[jQuery] How to block the javascript engine when jQuery.ui.dialog is pop up?

[jQuery] How to block the javascript engine when jQuery.ui.dialog is pop up?


Hi, I am trying to replace javascript built-in alert & prompt with
jQuery.ui.dialog, the problem is dialog won't block the javascript
engine from excuting statements following the dialog("open"). Is there
an elegant solution for this? Thanks.