PDA

View Full Version : hvmenu



ken edwardsen
04-14-2005, 03:11 PM
hi
the menu works fnine with web urls
(Menu2=new Array("Legal","http://www.abcnews.com","",2);

but if i want to open something locally
(Menu1=new Array("FAQs","FAQ.htm","",0,20,75);
it cant be opened

i suppose
Menu1=new Array("FAQs","http://www.mysite.com/FAQ.htm","",2);
will work but why wont the shorter (faster?) way work

thanks
ken

trumpet
04-14-2005, 06:34 PM
Should work fine. What happens when you use the shorter version?

ken edwardsen
04-15-2005, 01:01 PM
i get the typical ie warning that "this page cannot be displayed"

do you have an idea as to where to start looking for a solution

i dont
ken

jscheuer1
04-15-2005, 02:25 PM
Well, what you have is in case 1:

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

(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:

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.

ken edwardsen
04-15-2005, 03:16 PM
i'll have to chew on that for a while but i understand what youre saying

few things are easy i guess

thanks
ken