User Guide

ADOBE GOLIVE CS2
User Guide
604
See also
“Navigating source code by function” on page 600
Source preferences” on page 578
To edit an existing JavaScript
1 To open the JavaScript Editor, do one of the following:
Double-click the JavaScript icon in the document window.
Select the JavaScript icon in the document window, and then click the Edit button in the Inspector.
2 If the icons on the toolbar in the JavaScript Editor are inactive, choose a script name from the list at the left side
of the JavaScript Editor.
Create event definitions by entering event codes in the Event Code text box.
3 Choose an option from the View menu, and then drag an object from the Object list in the Script Inspector to the
JavaScript Editor window. For example, choose Events from the View menu to display a list of JavaScript events that
you can insert in your JavaScript.
4 In the Script Inspector, enter event code in the Event Code text box to create event definitions.
Choose a function declaration from the Navigate Through Code pop-up menu in the JavaScript Editor toolbar to
navigate directly to that location in the script. (See “Navigating source code by function” on page 600.)
5 Close the JavaScript Editor to save your work.
6 Do one of the following to open your web page in the browser you selected for previewing and testing in the
Preferences dialog box:
Choose File > Preview In > Default Browser.
Click the Preview In Browser button on the toolbar.
Sample JavaScript code
The following sample JavaScript code shows how to use a simple JavaScript to display the time and date obtained
from the viewer’s operating system.