Dreamweaver

Apply the Call JavaScript behavior

The Call JavaScript behavior executes a custom function or line of JavaScript code when an event occurs. (You can write the script yourself, or you can use code provided by various freely available JavaScript libraries on the web.)

  1. Select an object and choose Call JavaScript from the Actions menu of the Behaviors panel.
  2. Type the exact JavaScript to be executed, or type the name of a function.

    For example, to create a Back button, you might type if (history.length > 0){history.back()} . If you have encapsulated your code in a function, type only the function name (for example, hGoBack() ).

  3. 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.