|
Contributed by Joe
|
|
Thursday, 27 July 2006 |
Javascript Alerting the UserThe window object provides the alert method, which allows you to display a simple dialog box containing a text message followed by a single button the user can use to acknowledge the message and close the dialog box.
Call the window.alert method to display a message in a dialog box:JavaScript alert code<head> <script language=”JavaScript”> <!-- window.alert(“Hello”); // --> </script> </head> To confirm with the User In addition to the alert method, the window object also provides the confirm method, which allows you to display a dialog box containing a text message followed by two buttons the user can use to acknowledge or reject the message and close the dialog box. Typically these buttons are labeled OK and Cancel. See following code <script language=”JavaScript”> <!-- var result = window.confirm(“Click OK to continue”); // --> </script> Call the window.confirm method to display a message in a dialog box, assign the selection of the user |
|
Last Updated ( Friday, 28 July 2006 )
|