result = window.confirm(message);
message is the string to be displayed in the dialog.
result is a boolean value indicating whether OK or Cancel was selected (true means OK).
if (window.confirm("Want to see my mood ring?")) {
window.open("mood.html", "mood ring", "");
}
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.
Page last modified 17:01, 5 Jan 2008 by Mgjbot