Sun Web Application Guidelines - Version 4.1
Search Guidelines    |    Send Feedback   |    Developers.sun.com

How To Use These Guidelines - An Introduction
 

3 Windows and Content Pages > 3.3 JavaScript Windows

3.3 JavaScript Windows

JavaScript windows come in three implementation types: confirmation, alert, and prompt (all fully modal, but limited in controls). They prevent interaction with the browser so the user must take an action in the JavaScript window before moving on to the next task. These windows have a standard icon that cannot be changed, read-only text messages, and OK and Cancel buttons.

Type

Characteristics

Example/ Javascript Code

Confirmation

Has OK and Cancel buttons.



confirm( 'Do you Really Want Bacon?\n\nBacon is very bad for you.\nClick OK to confirm or Cancel to skip.' )

Alert

Has OK button only.



alert( 'Invalid Value\n\nThe number of bacon strips must be a value between 0 and 3.' )

Prompt

Prompts user for input in a single text field.

Has OK and Cancel buttons.



prompt( 'What would you like instead of bacon?', 'dry toast' )

Required

Back to TopBack to Top

3 Windows and Content Pages > 3.3 JavaScript Windows

Privacy Policy  |  Terms of Use  |  Trademarks  |  Copyright 2007 Sun Microsystems, Inc.