Well, what you have is in case 1:

Originally Posted by
ken edwardsen
(Menu2=new Array("Legal","http://www.abcnews.com","",2);
is an absolute URL and in case 2:

Originally Posted by
ken edwardsen
(Menu1=new Array("FAQs","FAQ.htm","",0,20,75);
a relative URL. Now on my computer and on the handful of servers I have dealt with, the first case, the absolute URL always works without much thought needed. The second case however, being relative, requires me to think, relative, relative to what? In most cases it is relative to the location of the page not the script in which it appears. I would guess that your javascript file is someplace other than your page that is using it is. For example, a simple script in the directory 'scripts' we will call it test.js:
Code:
document.write('<a href=leaves.html>leaves</a>')
window.onload=window.open('../leaves.html','mywin')
the file 'leaves.html' is in the root directory, not the scripts directory. If I call this script from a page in the root of the scripts directory, the document.write link when clicked works but the window.open link causes an error. If I call this script from a directory one level above the root, the document.write link fails but the window.open link works. This type of behavior is why it is best to specify absolute URL's when using them in external scripts.
Bookmarks