Board Logo

Relative Link to js files
PatrickLosey - 1/28/2009 at 12:53 AM

I have the code on an index.htm page and it works fine. But I have several pages within an 'about' sub-directory with relative links to all the js files. The index.htm page on the root works fine but none of the pages in the 'about' directory will display the menu.

I have changed the relative links to absolute but that did not help either. Am I missing something? Any help is appreciated.


**********************

index.htm

<link href="style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="assets/menu_files/menu.js"></script>
<script language="JavaScript" src="assets/menu_files/items.js"></script>
<script language="JavaScript" src="assets/menu_files/template.js"></script>
<link rel="stylesheet" href="assets/menu_files/menu.css">

</HEAD>

<BODY>
<script language="JavaScript">
<!--
new menu (MENU_ITEMS_XP, MENU_POS_XP);
//-->
</script>


about/history.htm

<link href="../style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="../assets/menu_files/menu.js"></script>
<script language="JavaScript" src="../assets/menu_files/items.js"></script>
<script language="JavaScript" src="../assets/menu_files/template.js"></script>
<link rel="stylesheet" href="../assets/menu_files/menu.css">

</HEAD>

<BODY>
<script language="JavaScript">
<!--
new menu (MENU_ITEMS_XP, MENU_POS_XP);
//-->
</script>


tigra - 1/28/2009 at 01:55 AM

you'll need to use absolute path in configuration variable in menu.js file

var TMenu_path_to_files='/assets/menu_files/';

or whatever is the absolute path to that directory. note that path should start with / or http://


PatrickLosey - 1/29/2009 at 12:37 AM

That worked!
Thank you.


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