Absolute vs relative URLS

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
jeallen
Advanced
Advanced
Posts: 16
Joined: Sat Sep 27, 2003 9:23 pm
Location: Huntsville, AL USA
Contact:

Absolute vs relative URLS

Post by jeallen »

I have the menu bars working fine, but I read that I can use relative links vs absolute. I read this to mean I shouldbe able to do the following:

aI("text=Our Staff;url=http://www.fcc-hsv.org/staff/index.html;");
- or -
aI("text=Our Staff;url=/staff/index.html;");

However I get a script error when I use this syntax.

Is there something simple I am doing wrong here?
User avatar
stephen702
Super Advanced
Super Advanced
Posts: 77
Joined: Wed Jul 16, 2003 4:53 am
Location: Davis, CA
Contact:

Post by stephen702 »

If your menu page is in the default directory, your problem probably is the initial slash, which is sending your request to another directory.

Try

aI("text=Our Staff;url=staff/index.html;");
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

You were right on the syntax there jeallen....the leading / means absolute URL and tells it to start from the root of the website and starting looking from there. To be getting a script error seems odd, if you could, please post a URL or your entire menu_data file. Thanks.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
jeallen
Advanced
Advanced
Posts: 16
Joined: Sat Sep 27, 2003 9:23 pm
Location: Huntsville, AL USA
Contact:

Yep is does indicate a script error, but only in FrontPage

Post by jeallen »

It's really curious, the other problem I am experiencing is when previewing in FP 2002 the sub-image links appear broken (except in root level docs), unless a absolute (http://..) paths are used for the image. However, it works fine when published.

Its curious, because in this case, FP 2002 prview indicates a script error unless absolute paths are used for the URL:

aI("text=About Us Home;url=http://www.fcc-hsv.org/about_us/index.html;");
- vs -
aI("text=About Us Home;url=/about_us/index.html;");

However, Once again, it works fine when published. It is a greater concern however because it prevents me from verifying script operation prior to publishing.

menu_data.js is in root all scripts are in /milonic
Post Reply