Use the JavaScript editor to work on your
script with syntax coloring and content assist.
About this task
Syntax coloring specifies how the JavaScript source code is rendered with its own color and style. To change the default syntax
color preferences, in Document Studio select .Content assist shows a list of valid alternatives for completing the
current line of code. To activate the content assist, press Ctrl +
Space.
Procedure
- Double-click the JavaScript code
element.
The Input code for JavaScript
code element window opens.
- Optional:
If you are including a new script from another file, click Include
script and select a file from your computer, a remote server, or from the Publishing Document Builder component. Click OK.
For files selected from your computer or a remote server, a copy of
the JavaScript code from your selected file opens in the
JavaScript editor.
For files that are selected from
the
Publishing Document Builder, the
Use Script Reference window
opens. Choose whether to include the JavaScript as a
reference link in the template:
- Optional:
Click Open in editor to enter the script in an Eclipse
JavaScript editor.
The script opens in a new editor tab as a temporary
.js file, such that you can edit the JavaScript and manage the script through the options in the Outline view. After you edit the
script, save your changes and close the temporary JavaScript editor tab to return to the Input Code for JavaScript Code
Element window.
- Click Test script to validate
the code.
- Click OK to save the changes
and exit the window.