DOM:window.confirm
From MDC
Contents |
[edit] Summary
Displays a modal dialog with a message and two buttons, OK and Cancel.
[edit] Syntax
result = window.confirm(message);
-
messageis the string to be displayed in the dialog. -
resultis a boolean value indicating whether OK or Cancel was selected (truemeans OK).
[edit] Example
if (window.confirm("Want to see my mood ring?")) {
window.open("mood.html", "mood ring", "");
}
[edit] Notes
Dialog boxes are modal windows - they prevent the user from accessing the rest of the program's interface until the dialog box is closed. For this reason, you should not overuse any function that creates a dialog box (or modal window).
Chrome users (e.g. extensions) should use methods of nsIPromptService instead.
[edit] Specification
DOM Level 0. Not part of any standard.