Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript relative paths

Status
Not open for further replies.

iceman2654

Programmer
Jul 9, 2003
53
CA
How do you call a javascript from another directory?

<SCRIPT SRC="menu.js"></SCRIPT>

is what I have with all the stuff in one folder. Kinda messy for me....

then i tried

<SCRIPT SRC="\menu\menu.js"></SCRIPT>

and many combinations with the / and \ and ..
but it didn't work.

So basically, how do load javascripts from the menu directory?
 
Try
Code:
<SCRIPT SRC="menu\menu.js"></SCRIPT>
 
nope didn't work...i've already tried that....everything sorta just disappears!
 
where is the html file and the menu file? can u give an example path?

Known is handfull, Unknown is worldfull
 
need to give more info on source of files. if you need to go back a folder, say the html file is in c:\html\htmlfile.html and the js file is in c:\menu\menu.js, you will have to put:

Code:
<script src="../menu/menu.js"></script>
 
oops sorry guys....it turns out that the error was with the flash source path. I guess I hafta also tell it to look in the menu folder because it's calling it from the folder above it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top