Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Advanced tutorial javascript

610993Dec 21 2007 — edited Dec 23 2007
Hi!

I am a bit confused about the apex 3.0 Advanced Tutorial chapter 10 "How to Incorporate JavaScript into an Application". Here is an excerpt:

-- start citation --

Including JavaScript in a .js File Referenced by the Page Template

In Oracle Application Express you can reference a .js file in the page template. This approach makes all the JavaScript in that file accessible to the application. This is the most efficient approach because a .js file loads on the first page view of your application, and is then cached by the browser.
The following code demonstrates how to include a .js file in the header section of a page template. Note the line script src= that appears in bold.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>#TITLE#</title>
#HEAD#
<script src="http://myserver.myport/my_images/custom.js" type="text/javascript"></script>
</head>
<body #ONLOAD#>#FORM_OPEN#

-- end citation --

The above seems to suggest that the "custom.js" lives on some server which should be hardcoded into a template. I can't believe it! What does incorporating mean here? For me it should mean an ability to add a javascript file to an application and then referencing it via a relative path so the script keeps staying with the application. I presume the tutorial is wrong about it. But what is the right way? I see there is an ability to add a static file to an application. Could it help here? I would appreciate an advice on how to add a javascript file.

Sergey
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 20 2008
Added on Dec 21 2007
2 comments
714 views