| JavaScript & HTML Tips | |
| Home | Feature highlight: Popup Dialogs to Interact with Users Credit: Imagenation Description Background Alerts are used to send a simple popup message or warning to the user. Since developers do not have control over the warning icon and the popup title - some try to avoid this message popup because it has connations of something going wrong. But it is simple and easy to use. num = prompt("Fill in blackboard how manytimes ?","20") Prompts allow users to get a response from the user. The first parameter is what the user will be prompted for; the second parameter is the default value. Note prompt returns a value stored in num in this case. But if the user cancels the prompt the whole routine is abandoned. confirm("Are you sure you want to clear the Blackboard"); Confirms allow the developer to get a yes/no response from the user on what to do next. Confirm returns True if the user clicks the OK button and returns False if the user clicks the Cancel button. Simple but effective. Use View | Source to see all the details on how Bart did his mischief on this page. |
Top of Page Tutorials Home JavaScript References JavaScript Books |