infoCopter.com
retoh's Online Repository for myself and other Web Geeks

home | newsletter | site map

Free Stuff

: links

: Neue Surf Tips

: know-how

: Zitate

: Spam Strike

: HTML Checker!

: Link Checker

: Cartoons



About IC

: friends

: lust und frust

: guestbook

: what's new

Dialog
See also
p-friendly
Home :: Know-how :: Dialog


var players = 0;

while (players < 1 || players > 2)
  players = prompt("Enter number of players (1 or 2)", 1);
  
if (players == 2) alert("Choose your partner!");

confirm
 Displays a Confirm dialog box with the specified message and OK and Cancel buttons


Method of
 window
 
Implemented in
 JavaScript 1.0
 


Syntax 

confirm(message)

Parameters 

message
 A string.

Examples

This example uses the confirm method in the confirmCleanUp function to confirm that the user of an application really wants to quit. If the user chooses OK, the custom cleanUp function closes the application.

function confirmCleanUp() {
   if (confirm("Are you sure you want to quit this application?")) {
      cleanUp()   }
}


another example

function confirm_url (message, next_url) {
	confirm_result = confirm(message);
	if (confirm_result == true) {
		document.location = next_url;
		return true;
	} else { }
}


See also 
window.alert, window.prompt 
Know-How home | Must Read | What's new? | iC Site Map
link search
©1998-2004 infoCopter