Chapter 12. Behaviors and JavaScript

Dreamweaver provides numerous preprogrammed behaviors that add interactivity, check the browser version, control window layout, and perform animation. If Dreamweaver doesn’t have a built-in behavior for the job, you can download more behaviors from the Dreamweaver Exchange or write your own in JavaScript (JS).

For more on JavaScript, see the O’Reilly JavaScript Reference in the Reference panel (Window Reference) or see JavaScript: The Definitive Guide by David Flanagan (O’Reilly). Note that JavaScript (which was called LiveScript until Netscape renamed it) has no direct relation to Sun’s Java language; people in this industry just drink too much coffee. Macromedia Flash’s ActionScript language uses the same syntax as JavaScript and implements some identical object classes (both are derivatives of the ECMA-262 standard).

Even if you don’t know JavaScript, Dreamweaver makes it easy to use JavaScript via its built-in behaviors. In fact, we’ve already used some behaviors earlier in the book. The rollover image, navigation bar, and jump menu objects are implemented using built-in behaviors.

Browser JavaScript Support

Dreamweaver’s behaviors are implemented in JavaScript and therefore require a JavaScript-capable browser. Table 12-1 lists the JavaScript versions supported by the major browsers. (Microsoft’s implementation of JavaScript is called JScript. Although JScript is very similar to JavaScript, it is not identical. If you create your own behaviors, ...

Get Dreamweaver in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.