Tuesday, August 12, 2008

How to Add JavaScripts to a Web Page With Dreamweaver

With Dreamweaver 3, you can specify "behaviors" (something you want to have happen, such as a sound playing), and events (the "trigger" that launches the action, such as moving the mouse over an object) without writing JavaScript code. But you can also import pre-written JavaScript code and add it to your page in the same way that you add the included behaviors.


Step1
If you have a JavaScript you want to use, open the file where the JavaScript is located. If you're downloading a Dreamweaver extension file, use a file decompression program, such as WinZip or ZipIt, to extract the file.


Step2
Locate and open the folder where the Dreamweaver program is installed (such as Programs). Find and open the Configuration folder, then the Actions folder.


Step3
Paste or extract the JavaScript file into the Actions folder.


Step4
Restart the Dreamweaver program and proceed to the next section.

Using a Dreamweaver Behavior or Imported JavaScript


Step1
Start the Dreamweaver program and open the page that the JavaScript or behavior will be added to.


Step2
Open the Window menu and choose Behaviors, or press the F8 button. This opens the Behavior Inspector.


Step3
Select the text or object that the behavior or JavaScript will be attached to. In the Behavior Inspector, choose the browser you are designing the page for. (Some behaviors can only be used with certain browsers.)


Step4
Click on the Plus sign and choose the imported JavaScript or a Dreamweaver behavior (see Tips for more information about the behaviors). Dimmed behaviors cannot be used on your page; to get more behavior options, choose a more recent browser, such as Internet Explorer 5.


Step5
Select the parameters for the behavior (any values the behavior needs to run) and click OK.


Step6
Choose the event that triggers the behavior by clicking on the arrow button next to the behavior and selecting the desired event.


Step7
Save the page, then test it by selecting Preview in Browser from the File menu and performing the event (such as double-clicking).


Find and buy tickets by states

No comments: