Building Modal Dialogs into Your Web Application
Interrupting the User
Usability experts agree that interaction with web sites should be primarily user-driven, but sometimes we need to interrupt whatever the user is doing and force her to make a decision. For example, if the user has just filled in a long form and tries to leave the page with the Back button, it’s sensible to ask whether that’s really her intention. Likewise, if a sensitive financial transaction has just been triggered, it makes sense to prevent the user from activating other links, modifying the input fields, or resubmitting the transaction.
messageBox(prompt, caption, flags, callback)
prompt: Text to be displayed in the body of the dialog box. The prompt can contain HTML markup (for example, the <b> tag).
caption: Text to be displayed in the title bar of the dialog box.
flags: Specifies the buttons that will be displayed in the dialog box, as well as the icon displayed left of the prompt text.
Removes the modal dialog box. Callback function is not called.