|
Helping ordinary people create extraordinary websites! |
JavaScript Popup WindowsOften you will want to show some text to the user in a popup window, ask them to confirm an action, or even ask them a question. JavaScript provides a few useful functions for doing so. JavaScript AlertAn alert is the simplest popup, simply showing a message to the user and typically an "OK" button.
JavaScript ConfirmIf you want your user to confirm an action, use the
The function takes one parameter, the message to be displayed, and returns true if the user clicked "OK"/"Yes", false otherwise. JavaScript PromptOccasionally you will want to request input from the user. The
The function works similarly to Web page popupYou can also open a popup window to an entirely seperate web page. This can be achieved via
The You can also tie this to an <script type="text/javascript"> When the "Click me!" link is clicked on, a popup window will open.
|
|