We are providing HierMenus to you at no cost. HierMenus code requires a confirmed membership with internet.com. Please register by clicking here and come back soon to download your free copy of HeirMenus code.
Click Here to Register

Site Navigation
Bulletins
About
Documentation
FAQ
Samples
Known Issues
Technology Jobs

internet.commerce

Partner With Us














          
internet.com

IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

 
HierMenusCentral Enhance the Functionality of Your Web Site with DHTML HierMenus.
    

home / faq / faq 5

Frequently Asked Question #5

Question: Do the HM files have to be in the same directory as the HTML page that uses them? I want to have the files in one directory accessible from my whole site.

Answer: No they do not, and in fact we strongly recommend that you place your HM scripts and images all in centralized directories. You can keep these files all in centralized directories as long as you indicate to HM where the directories are and "load" the files from these directories.

Unlike many other scripts, HM has an external script (HM_Loader.js) loading other external scripts (HM_Config.js and HMScriptxxx.js.) HM_Loader.js is loaded into your HTML page with a tag that looks similar to--if not exactly like--this one:

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

In HierMenus version 6, you can tell HierMenus where to find the scripts, configuration files, and images on your system using the HM_ScriptDir, HM_ConfigDir, and HM_ImageDir global parameters. HM_ScriptDir and HM_ImageDir are also available in HierMenus version 5. If you are using one of these two versions, refer to the appropriate links below and skip the remainder of this discussion. (You're welcome to read it if you're interested in learning about the HM Loading mechanism; but the actual techniques described will be unnecessary for you.)

Version 5
Setup Instructions, Step 2

Version 6
Setup Instructions, Step 1
HM_ScriptDir
HM_ConfigDir
HM_ImageDir

Version 4.x Instructions

In HM Version 4.x, you can edit HM_Loader.js directly to tell it where to find your script files. HM_Loader.js contains these statements (below) to load the other scripts:

if(HM_IsMenu) {
    document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='HM_Arrays.js' TYPE='text/javascript'><\/SCR" + "IPT>");
    document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='HM_Script"+ HM_BrowserString +".js' TYPE='text/javascript'><\/SCR" + "IPT>");
}

For example, when we ran HierMenus version 4 In HierMenus CENTRAL, the files that created the navigation menu were all stored in this directory:

http://www.webreference.com/dhtml/hiermenus/scripts/

With version 4 HM, every page that used HM loaded HM_Loader.js with this syntax:

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

Alternately, we could of used:

<SCRIPT LANGUAGE="JavaScript1.2"
        SRC="http://www.webreference.com/dhtml/hiermenus/scripts/HM_Loader.js"
        TYPE='text/javascript'></SCRIPT>

So far, so good. Most readers who have asked this FAQ load HM_Loader.js correctly.

What is not immediately obvious, however, is that the other scripts are not loaded into HM_Loader.js, but into the HTML page that originally loaded HM_Loader.js. The contents of HM_Loader.js belong to the HTML page, and therefore the path to the scripts must match the path used to load HM_Loader.js:

if(HM_IsMenu) {
    document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='/dhtml/hiermenus/scripts/HM_Arrays.js' TYPE='text/javascript'><\/SCR" + "IPT>");
    document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='/dhtml/hiermenus/scripts/HM_Script"+ HM_BrowserString +".js' TYPE='text/javascript'><\/SCR" + "IPT>");
}

or

if(HM_IsMenu) {
    document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='http://www.webreference.com/dhtml/hiermenus/scripts/HM_Arrays.js' TYPE='text/javascript'><\/SCR" + "IPT>");
    document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='http://www.webreference.com/dhtml/hiermenus/scripts/HM_Script"+ HM_BrowserString +".js' TYPE='text/javascript'><\/SCR" + "IPT>");
}

In HM version 4, make sure the files loaded by HM_Loader.js have the correct path and you can access them from any page on your site.

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Created: 3/25/2004
Updated: 3/25/2004
URL: http://www.hiermenuscentral.com/documentation/faq/faq5.html