[Javascript] Reaching out to external JS file.

Mike Dougherty mdougherty at pbp.com
Fri Oct 3 17:16:53 CDT 2003


Don't use relative reference from the calling file - reference from the
root:

Ex: Src="/scripts/myscript.js"

No matter where the caller lives, it should use the explicit path (from
the root folder) to the script.

-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu] On Behalf Of Thierry Lavallée
Sent: Friday, October 03, 2003 3:30 PM
To: javascript at LaTech.edu
Subject: [Javascript] Reaching out to external JS file.


Hi!
I am importing a myscript.js file within a file. I use:
<csscriptdict import>
<script type="text/javascript" src="../myscript.js "></script>
</csscriptdict>

This script references another file like this:
document.write("<link href='IE.css' rel='stylesheet' media='screen'>")

Unfortunately this myscript.js file is to be called from other pages
within
the site and their hierarchy levels differ.

Is it possible to make sure the links are right?
I tried putting direct URLs for the src and href, but it does not seem
to
work better.

What am I missing?
thanks!
-- 
Thierry 

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list