Click to See Complete Forum and Search --> : HM 5.2.1 w/subdirectories


timware
09-29-2003, 10:31 AM
Hello (and sorry to be a pest!),

I'm setting up a pretty basic site with the index.html at the top level, the HM scripts in a directory called "hiermenus" and various subdirectories for each site section (eg "products", "company" etc.).

I'm trying to figure out the best way to organize the 2 scripts HM_Loader.js and HM_Arrays.js to be the most economical. It appears that I should use absolute or root links in the HM_Arrays.js when I push live, but how can I get the html files in the subdirectories to use the script without putting an HM_Loader.js in each directory?

I have it so that the index.html file in the directory calls the HM_Loader.js with

<SCRIPT LANGUAGE="JavaScript1.2" SRC="../HM_Loader.js" TYPE='text/javascript'></SCRIPT>


and in the top level I have the HM_Arrays and the HM_Loader.js, but it's not working.

Help? Thanks!

Tim

dragle
09-29-2003, 11:18 AM
Hi Tim,

I would put both HM_Loader and HM_Arrays in your hiermenus directory, then retrieve HM_Loader from within your pages via:

<script language="JavaScript1.2"
src="/hiermenus/HM_Loader.js"
type='text/javascript'></script>

or

<script language="JavaScript1.2"
src="http://mydomain.com/hiermenus/HM_Loader.js"
type='text/javascript'></script>

(The initial leading slash before the directory in the first example will retrieve the file from the top level hiermenus directory; even if the page itself is in a subdirectory). Remember to also set HM_ScriptDir in the HM_Loader file; otherwise it won't matter where you put the script files - HM won't find them.

HM_ScriptDir="/hiermenus/";

Sounds like you've already been there, but just in case not, see this page for more on script placement, etc:

http://www.webreference.com/dhtml/hiermenus/instructions/step2.html

Cheers!