Dreamweaver

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 Actions 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. If not, select another event or change the target browser in the Show Events For submenu.