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:

  1. Do any of the following:
    • To add a JavaScript to the body section of a page, drag the JavaScript icon JavaScript icon from the Basic tab Basic set icon of the Objects palette to your document window.
    • To add a JavaScript to the head section of a page, drag the Script icon JavaScript icon from the Head tab Head set  of the Objects palette to the document window or the head section pane.
  2. If it's not already selected, select the JavaScript icon JavaScript icon in the document window, or the Script icon Script icon in the head section pane.
  3. 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.
  4. To reference an external script file (which must have the .js extension), select Source and do one of the following:
    • Enter a resource locator for your script file.
    • Click the Browse button to select a script.
    • Drag from the pick whip in the Inspector to a script in the site window.