 |
|
APEX JavaScript Directory Hierarchy on the HTTP Server
Oracle Tips by Burleson Consulting |
JavaScript in the Directory
Hierarchy on the HTTP Server
Putting the JavaScript source code in the script
repository makes it reusable and it is easy to deploy in this
manner, but we can still do better. This next step is better
because it allows the users web browser to cache the easy_java.js
script locally. That way the next time the same script is
referenced it does not need to be downloaded to the users’ browser
since it was downloaded previously.
SEE
CODE DEPOT FOR FULL SCRIPTS
The following explanation assumes you have
access to the place files in the directory structure of the machine
where the HTTP Server is running. I also assume your images
directory is the same as the path shown here:
Windows:
C:\oracle\product\10.2.0\ohs\Apache\Apache\images
Unix/Linux:
/u01/app/oracle/product/10.2.0/ohs/Apache/Apache/images
What you need to do at this point is create a
new directory named easy_htmldb under the images directory.
C:\oracle\product\10.2.0\ohs\Apache\Apache\images\easy_htmldb
Then copy the easy_java.js script from the code
depot directory to new easy_htmldb directory. This places the file
in the correct location for us to reference it from each of the
application pages. It also makes it available to all applications
in all workspaces running from this HTTP Server.
To change the refenence in the HTML Header
region of the Java Script page navigate back to the page attributes
page and make the changes as shown in figure X.5.

Figure X.5 –
Using Java Script from File System
The changes in figure X.5 involve the
substitution string and a reference to the new easy_htmldb directory
(shown in bold below).
<script src="#IMAGE_PREFIX#easy_htmldb/easy_java.js"
type="text/javascript"></script>
%
You can reference the easy_java.js script directly
from a browser with the following URL:
http://localhost:7777/i/easy_htmldb/easy_java.js
For more information on this topic, see the
book "Easy Oracle HTML-DB Application Express
", the best book anywhere on expert APEX
development:
APEX developer support:
 |
For APEX development support just call to gat an
Oracle Certified professional for all APEX development
projects. |
 |
Easy Oracle HTML-DB Application Express
By Michael Cunningham & Kent Crotty
Only $27.95
Buy it now and get the code depot download
|
|