To create a JavaScript file, use the JavaScript wizard to generate the JavaScript file, then use the JavaScript editor or similar to edit the file. The method is described below.
Creating a New JavaScript File
From the [New] wizard, select [JavaScript] > [JavaScript Source File], and the wizard creates the JavaScript file. Refer to the following for the wizard settings:
Enter or select the parent folder
Select the folder where the JavaScript file is to be created.
File name
Specify the name of the JavaScript file to be created. If the extension is omitted, ".js" is used as the extension.
Editing the JavaScript File
Use the JavaScript editor to edit a JavaScript file. The JavaScript editor has the following features:
Highlighted display of syntax
Keywords, comments, character string literals, and so on, are each highlighted in different colors. The highlighting method can be customized by changing the preferences.
Contents Assist
Depending on the cursor position, suggestions concerning objects, methods, arguments, properties and so on are displayed in the Contents Assist list. Press the [Ctrl+Space] keys together to display the Contents Assist list, and enter characters to reduce the list of possible choices.
Validating the JavaScript
Verification of the description contents of JavaScript files is performed by a JavaScript validator. JavaScript files must be stored in the folder specified as the JavaScript source folder.
To specify the JavaScript source folder, follow the procedure below:
In the Project Explorer, select the target project.
From the context menu, select [Properties].
The [Properties] dialog box is displayed. In the left trees view, select [JavaScript] > [JavaScript Libraries].
In the [JavaScript Libraries] page, select the [Source] tab, then add the JavaScript source folder.
Point
In the case of a JavaScript project, the folder is set as the JavaScript source folder by default.
Note
Semantic analysis of JavaScript is not performed. As a result, the settings on the [Preferences] page or the [JavaScript] > [Validator] > [Errors/Warnings] page of the project [Properties] page may not be enabled.