I am having a problem with the menu and the url address of htm files.
The menu works fine as long as all the htm files are in the root directory. The root directory being "http://mywebpages.comcast.net/nationalsite"
From the "index" page the menu loads correctly and the url of each menu is correct, but once you click on a menu item to go to level below the root directoy i.e "http://mywebpages.comcast.net/nationalsite/2003/xxx.htm" that htm file loads fine, but the menu now shows that address of the menus items as "http://mywebpages.comcast.net/nationals ... 03/xxx.htm".
The only way out of this is to go back to the root (Home) page and start over. What is causing the menu to add the sub-directory to the path.
Address Issue
- trytrix
- Super Advanced
- Posts: 92
- Joined: Thu Sep 26, 2002 9:46 pm
- Location: Flanders / Belgium
- Contact:
Same issue as in topic "Subdirectory Menu Problem" !!
Trytrix
Trytrix
You're Never Fully Dressed Without A Smile !
"From Flanders, one of Europe's most dynamic regions" - Visit : http://www.toerismevlaanderen.be
"From Flanders, one of Europe's most dynamic regions" - Visit : http://www.toerismevlaanderen.be
Duh... sorry. I guess those were actual URLs and not just examples. Silly me.
The problem is your use of relative paths. You are often specifying a path relative to the current document's location. Take your "Tournament Sites" menu for example. The "Scores & Statistics" menu item is defined as follows:
That'll work from the top level (Home page), because the 2003 directory is a subdirectory of your root location, http://mywebpages.comcast.net/nationalsite. But once you're viewing http://mywebpages.comcast.net/nationals ... nfstat.htm, you are already in http://mywebpages.comcast.net/nationalsite/2003/. So, the next time you select the same menu item, the browser wants to load confstat.htm from the 2003 subdirctory of where the current document is, i.e., http://mywebpages.comcast.net/nationals ... nfstat.htm, which doesn't exist.
(1) Try using a "/" in front of your directory names.
(2) Alternatively, specify a base directory path in a <base> tag within the <head> section of each document.
I'd try option 1 first, since the editing is easier.
Hope that helps,
Kevin
The problem is your use of relative paths. You are often specifying a path relative to the current document's location. Take your "Tournament Sites" menu for example. The "Scores & Statistics" menu item is defined as follows:
Code: Select all
,"Scores & Statistics","2003/confstat.htm",,,1
(1) Try using a "/" in front of your directory names.
(2) Alternatively, specify a base directory path in a <base> tag within the <head> section of each document.
I'd try option 1 first, since the editing is easier.
Hope that helps,
Kevin
Alright, thanks Kevin. I got it to work. Here is what I did. Maybe some else can profit from my learning curve. I set up a variable inside of the "menu_array.js" file and I defined it just ahead of the variable that defines // The time delay for menus to remain visible. I defined my variable as:
var baseurl="http://mywebpages.comcast.net/nationalsite/";
which is my base url.
Then in each of the submenu items that point to a sub directory I used the variable "baseurl" in the following manner:
,"Scores & Statistics",baseurl+"2003/confstat.htm",,,1
Everything seems to work OK now.
Thanks again Kevin for your wisdom.
var baseurl="http://mywebpages.comcast.net/nationalsite/";
which is my base url.
Then in each of the submenu items that point to a sub directory I used the variable "baseurl" in the following manner:
,"Scores & Statistics",baseurl+"2003/confstat.htm",,,1
Everything seems to work OK now.
Thanks again Kevin for your wisdom.
I did try it before I started asking for help. It did not work. When I used the "variable" just for those links under Tournament Sites, they worked, but the other main menu items also were affected, so I had to add the "variable" to all links throughout the menu. Once you load the menu system from a sub directory, it causes all links within your menu to have wrong address.