Setting up JavaScript
You can add JavaScripts to your document. You can also insert JavaScripts in the head section pane of the document window to allow a script to be executed while the visible section of the document is still being loaded.
To set up a JavaScript: - Do any of the following:
- To add a JavaScript to the body section of a page, drag the JavaScript icon from the Basic tab
of the Objects palette to your document window. - To add a JavaScript to the head section of a page, drag the Script icon from the Head tab
of the Objects palette to the document window or the head section pane. Alternatively, you can click the JavaScript Editor button in the upper right of the document window. Then click the Create Script button on the toolbar in the JavaScript Editor.
The JavaScript icon and Script icon in the Objects palette A. JavaScript icon B. Script icon - If it's not already selected, select the JavaScript icon in the document window, or the Script icon in the head section pane.
- In the Inspector, enter a descriptive name in the Name text box. Choose a target browser from the Language pop-up menu. The language version corresponding to your browser selection appears in the text box below the menu.
- To reference an external script file (which must have the .js extension), do one of the following:
- Select Source and then enter a resource locator for your script file.
- Click the Browse button to select a script.
- Drag from the Point and Shoot button in the Inspector to a script in the site window.
|