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

Hour 11. 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 11.3. This dialog box simply gives the user a message.

    Figure 11.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 11.4.

    Figure 11.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