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
General
res_test.html

main_nav
menu.js
(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>
</csimport>

in the body

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

Thanks for your help,
Chris


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">

etc.


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/