doggo18
04-28-2003, 10:36 PM
Well I am working on my site, which has alot of subdirectories. Now I have one external .js file, which all my html files, in the same directory, and upto 5 subdirectories deep, all load in their <head> section.
Now the problem, a part of this script wants to load some images. Only it seems like the relative path I specify, is from the html file that is calling the script.. for example I have mysite/sub1/sub2/sub2.html calling mysite/external.js (../../external.js to be precise). When my script wants to load mysite/images/image1.gif with the relative path "images/image1.gif" it fails. It seems like it's taking the path of my sub2.html file. How do I solve this?
Using /images/image1.gif is no option, as it is not the head folder. Nor can I hardcode the path because the path will be changing, depending on the computer I am logged on (stupid school projects!)
Thanks :)
Now the problem, a part of this script wants to load some images. Only it seems like the relative path I specify, is from the html file that is calling the script.. for example I have mysite/sub1/sub2/sub2.html calling mysite/external.js (../../external.js to be precise). When my script wants to load mysite/images/image1.gif with the relative path "images/image1.gif" it fails. It seems like it's taking the path of my sub2.html file. How do I solve this?
Using /images/image1.gif is no option, as it is not the head folder. Nor can I hardcode the path because the path will be changing, depending on the computer I am logged on (stupid school projects!)
Thanks :)