js file and the .js file added to the JSP using the tag.
1.7 JDeveloper Integrated JavaScript Editor 11
Creating the JavaScript file separately has an advantage as the integrated
JavaScript Editor may be availed of. Create a JavaScript file by selecting
File>New and in the New Gallery window Web
Tier>HTML>JavaScript File. Copy some JavaScript code to the
JavaScript file. Create a JSP file to add the JavaScript file to with
File>New. In the New Gallery window select Web Tier>JSP in
Categories and select JSP in Items. The JavaScript file and the JSP file
are shown in Fig. 1.1.
Fig. 1.1 JavaScript File
One of the features of the JavaScript editor is syntax highlighting. To
add syntax highlighting select Tools>Preferences and in the Preferences
window select Code Editor>Syntax Colors. Select JavaScript in the
Language list. The Font Style, Foreground color and Background color
may be set for the different JavaScript constructs in the Syntax Colors
window as shown in Fig. 1.2.
12 1 What is Ajax?
Fig. 1.2 Setting Syntax Highlighting
JavaScript editor also provides code completion. As the JavaScript
syntax varies in the different browsers we need to specify the browser for
which code completion is to be implemented. Select JavaScript Editor in
the Preferences window and select a Target Browser for code
completion as shown in Fig. 1.3.
Fig. 1.3 Selecting Target Browser
1.
Pages:
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40