Please Note:
HierMenus is protected by copyright laws. Use of the HierMenus code requires a paid licensing agreement.
Click Here to Register

Site Navigation
Bulletins
About
Documentation
FAQ
Samples
Known Issues
Technology Jobs

internet.commerce

Partner With Us
Home Improvement
Holiday Gift Ideas
Online Shopping
Server Racks
Car Donations
KVM over IP
Compare Prices
Disney World Tickets
Compare Prices
Remote Online Backup
Web Hosting Directory
GPS Devices
Promotional Gifts
Memory Upgrades

          
internet.com

IT
Developer
Internet News
Small Business
Personal Technology
International

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.



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
Created: 3/25/2004
Updated: 3/25/2004
URL: http://www.hiermenuscentral.com/documentation/faq/faq5.html