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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read about script 1

Status
Not open for further replies.

svagelis

Programmer
May 2, 2001
121
GR
i have a incuded an external js file to my page.
p.e.
<script language=&quot;JavaScript1.2&quot; src=&quot;../../menu2.js&quot;>
</script>

i m using the property <b>window.document.scripts[0].src</b> to get the source of the file.
Well it works on IE but it doesnt on Netscape.
is there a property to get that information? i mean &quot;../../menu2.js&quot;

Thanks in advance !!!
 
Well i have a script that creates a menu and it s located my root directory.
Many pages includes this script from different folders subfolders etc.
this menu has links to local pages in folders subfolders etc.
well if i call this menu from a page which isnt located in the root dir the link is broken (relative link).
p.e. if i have a page \data\general.htm which calls ..\menu.js
and i have i link in menu.js which is \data\general.htm
the link becomes \data\data\general.htm. I come with a solution to read the src of the linked menu.js p.e. ..\menu.js
if i put this ..\ before it goes ..\data\general.htm
but i cant read it in netscape
 
Well i ve Found it
its
window.document.documentElement.getElementsByTagName(&quot;script&quot;)[0].src;

thanks anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top