As Chapter 11 makes clear, Dreamweaver's behaviors (prewritten JavaScript programs) let you add exciting interactive effectsmouse rollovers, pop-up windows , animated layers , and so onwith very little effort. But they can't do everything: When you, the native JavaScript speaker, need to wade into the depths of Java-Script programming yourself, you'll find two entrances within Dreamweaver.
The most straightforward approach, especially if you're already familiar with Java-Script programming, is to simply switch into Code view (Ctrl+` [Option-`]) and type away. Or, if you prefer, you can use Dreamweaver's Insert Script window to add your JavaScript code (see Figure 9-17).
To add your JavaScript code, click in either the head or body section of the page, and then choose Insert
HTML
Script Objects
Script (alternatively, you can access this option from the Script menu on the HTML tab of the Insert bar). In the Insert Script window (Figure 9-17), choose a language from the menu: JavaScript, JavaScript1.1, JavaScript1.2, or VBScript. (The JavaScript option works with all browsers that understand JavaScript, while JavaScript 1.2 works only in 4+ version browsers. VBScript, on the other hand, works only in the Windows version of Internet Explorer.)
Head Content, which opens a small bar below the Document toolbar that lists all of the different tags like <title>, <script>, and <meta> that appear in the head of a page. Click here, and then follow the above recipe for inserting a script.
Dreamweaver also lets you open and work on external JavaScript files (.js files) right in Code view. The program doesn't try to interpret the file as an HTML page; it won't attempt to make any of the changes described on Section 9.1.1. But you can just use the built-in text-editing capabilities of Code view to write your JavaScript programs.