• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Hour 13. Using Windows and Frames > Displaying Dialog Boxes

Displaying Dialog Boxes

The window object includes three methods that are useful for displaying messages and interacting with the user. You've already used these in some of your scripts. Here's a summary:

  • The alert method displays an alert dialog box, shown in Figure 13.3. This dialog box simply gives the user a message.

    Figure 13.3. A JavaScript alert dialog box displays a message.

  • The confirm method displays a confirmation dialog box. This displays a message and includes OK and Cancel buttons. This method returns true if OK is pressed and false if Cancel is pressed. A confirmation is displayed in Figure 13.4.

    Figure 13.4. A JavaScript confirm dialog box asks for confirmation.

  • The prompt method displays a message and prompts the user for input. It returns the text entered by the user.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint