 |
|
APEX JavaScript static file repository
Oracle Tips by Burleson Consulting |
JavaScript file in the static file repository
This is all fine and works just fine, but after
you have developed the JavaScript function as described above you
will want to put it into a script so you can make it reusable on
several web pages. If you already have a JavaScript file you have
created previously, or downloaded reusable code from the internet,
you can follow the same steps mentioned here to add the file to the
script repository.
First, create the JavaScript file named
easy_java.js using the code in Listing X.1. However, when
converting the inline code from the HTML Header section you will
need to remove the <script> and </script> tags. These tags are
necessary in the HTML Header section, but are not permitted when the
code is in a JavaScript file. You may also use, or view as a
reference, the file named easy_java.js in the code depot.
To upload the easy_java.js script into the
script repository:
1.
Navigate to Shared Components for the Easy Samples
application.
2.
Click on the Static Files link.
3.
Click the Create button.
4.
Application: select the Easy Samples option.
5.
Filename: click the Browse… button and navigate to the Code
Depot and select the easy_java.js file.
6.
Click the Upload button.
SEE
CODE DEPOT FOR FULL SCRIPTS
Now you have added the easy_java.js script to
the script repository and it is available for all application pages
to take advantage of. Navigate back to the page attributes page for
the Java Script page and edit the HTML Header text area to include
the text as shown in Figure X.4.
Referencing the functions, in the uploaded
JavaScript file, on a single APEX page is done by adding the
following code to the HTML Header section of the Page attributes
page.

Figure X.4 –
Using JavaScript from Script Repository.
APEX developer support:
 |
For APEX development support just call to gat an
Oracle Certified professional for all APEX development
projects. |
For more information on this topic, see the
book "Easy Oracle HTML-DB Application Express
", the best book anywhere on expert APEX
development:
 |
Easy Oracle HTML-DB Application Express
By Michael Cunningham & Kent Crotty
Only $27.95
Buy it now and get the code depot download
|
|