Behaviors > Using the behavior actions that come with Dreamweaver > Popup Message |
The Popup Message action displays a JavaScript alert with the message you specify. Because JavaScript alerts have only one button (OK), use this action to provide information rather than to present the user with a choice.
You can embed any valid JavaScript function call, property, global variable, or other expression in the text. To embed a JavaScript expression, place it inside braces ({}
). To display a brace, precede it with a backslash (\{
).
Example
The URL for this page is {window.location}, and today is {new Date()}.
Note: You can't control how the JavaScript alert looks; that's determined by the visitor's browser. If you want more control over the appearance of your message, consider using the Open Browser Window behavior. For details, see Open Browser Window.
To use the Popup Message action:
1 | Select an object and open the Behaviors panel. |
2 | Click the Plus (+) button and choose Popup Message from the Actionspop-up menu. |
3 | Enter your message in the Message field. |
4 | Click OK. |
5 | Check that the default event is the one you want. |
If it isn't, choose another event from the pop-up menu. If the events you want are not listed, change the target browser in the Show Events For pop-up menu. | |