Board Logo

web page in sub folder menu wont work
p51mustang - 6/13/2008 at 02:58 PM

I am placing my html pages in a directory and the nav menu_files (renamed: main_nav) in the root folder and the nav will not show up. However, the menu does show up it the page is in the same directory as the nav script. Why?

This is my root

(all other files, menu_green.css, etc.)

The script below is what is on my html page and in the javascripts.

Path for menu.js
var TMenu_path_to_files='main_nav/';

html page head
<link rel="stylesheet" href="../main_nav/menu_green.css">
<link href="../main.css" rel="stylesheet" media="screen">
<script language="JavaScript" src="../main_nav/menu.js"></script>
<script language="JavaScript" src="../main_nav/items.js"></script>
<script language="JavaScript" src="../main_nav/template.js"></script>

in the body

<script language="JavaScript" name="Nav bar">
new menu (MENU_ITEMS, MENU_TPL);

Thanks for your help,

tigra - 9/22/2008 at 09:29 PM

relative paths resolve to different locations depending on where you use them.

use the absolute paths:
var TMenu_path_to_files='/main_nav/';

<link href="/main_nav/main.css" rel="stylesheet" media="screen">


Back to forum: