Results 1 to 5 of 5

Thread: hvmenu

  1. #1
    Join Date
    Apr 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default hvmenu

    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

  2. #2
    Join Date
    Apr 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Should work fine. What happens when you use the shorter version?

  3. #3
    Join Date
    Apr 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, what you have is in case 1:
    Quote Originally Posted by ken edwardsen
    (Menu2=new Array("Legal","http://www.abcnews.com","",2);
    is an absolute URL and in case 2:
    Quote 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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Apr 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i'll have to chew on that for a while but i understand what youre saying

    few things are easy i guess

    thanks
    ken

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •