Operation Manual
337
USING DREAMWEAVER
Adding JavaScript behaviors
Last updated 3/28/2012
6 Click OK and verify that the default event is correct.
Apply the Set Nav Bar Image behavior
This behavior has been deprecated as of Dreamweaver CS5.
Apply the Set Text Of Frame behavior
The Set Text Of Frame behavior allows you to dynamically set the text of a frame, replacing the content and formatting
of a frame with the content you specify. The content can include any valid HTML code. Use this behavior to display
information dynamically.
Although the Set Text Of Frame behavior replaces the formatting of a frame, you can select Preserve Background Color
to preserve the page background and text color attributes.
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()}.
1 Select an object and choose Set Text > Set Text Of Frame from the Add Behavior menu of the Behaviors panel.
2 In the Set Text Of Frame dialog box, select the target frame from the Frame menu.
3 Click the Get Current HTML button to copy the current contents of the target frame’s body section.
4 Enter a message in the New HTML box.
5 Click OK and verify that the default event is correct.
More Help topics
“Create frames and framesets” on page 185
Apply the Set Text Of Container behavior
The Set Text Of Container behavior replaces the content and formatting of an existing container (that is, any element
that can contain text or other elements) on a page with the content you specify. The content can include any valid
HTML source code.
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()}.
1 Select an object and select Set Text > Set Text Of Container from the Add Behavior menu of the Behaviors panel.
2 In the Set Text Of Container dialog box, use the Container menu to select the target element.
3 Enter the new text or HTML in the New HTML box.
4 Click OK and verify that the default event is correct.
More Help topics
“Insert an AP Div” on page 154