Chapter 11: javascript, Using javascript behaviors (general instructions), About javascript behaviors – Adobe Dreamweaver CC 2015 User Manual
Page 419: Behaviors panel overview

412
Last updated 6/3/2015
Chapter 11: Javascript
Using JavaScript behaviors (general instructions)
Note: The user interface has been simplified in Dreamweaver CC and later. As a result, you may not find some of the
options described in this article in Dreamweaver CC and later. For more information, see
About JavaScript behaviors
Adobe Dreamweaver behaviors place JavaScript code in documents so that visitors can change a web page in various
ways or initiate certain tasks. A behavior is a combination of an event and an action triggered by that event. In the
Behaviors panel, you add a behavior to a page by specifying an action and then specifying the event that triggers that
action.
Note: Behavior code is client-side JavaScript code; that is, it runs in browsers, not on servers.
Events are, effectively, messages generated by browsers indicating that a visitor to your page has done something. For
example, when a visitor moves the pointer over a link, the browser generates an onMouseOver event for that link; the
browser then checks whether it should call some JavaScript code (specified in the page being viewed) in response.
Different events are defined for different page elements; for example, in most browsers onMouseOver and onClick are
events associated with links, whereas onLoad is an event associated with images and with the body section of the
document.
An action is pre-written JavaScript code for performing a task, such as opening a browser window, showing or hiding
an AP element, playing a sound, or stopping an Adobe Shockwave movie. The actions provided with Dreamweaver
provide maximum cross-browser compatibility.
After you attach a behavior to a page element, the behavior calls the action (JavaScript code) associated with an event
whenever that event occurs for that element. (The events that you can use to trigger a given action vary from browser
to browser.) For example, if you attach the Popup Message action to a link and specify that it will be triggered by the
onMouseOver event, then your message pops up whenever someone places the pointer over that link.
A single event can trigger several different actions, and you can specify the order in which those actions occur.
Dreamweaver provides about two dozen actions; additional actions can be found on the Exchange website at
as well as on third-party developer sites. You can write your own actions
if you are proficient in JavaScript.
Note: The terms behavior and action are Dreamweaver terms, not HTML terms. From the browser’s point of view, an
action is just like any other piece of JavaScript code.
Behaviors panel overview
You use the Behaviors panel (Window > Behaviors) to attach behaviors to page elements (more specifically to tags) and
to modify parameters of previously attached behaviors.