Moving DHTML Menu from web page to .js file

Home » Forums » Free DHTML Menu Builder » Moving DHTML Menu from web page to .js file


Trial User
3 posts

I am using the DHTML menu on my website www.littleriverbb.com and I think it looks awesome. I am very happy with it and it is inserted via a .dwt so I only have to modify it once in order to have it changed on all my pages.

However, I have noticed that my pages are huge and that they would be very light if it were not for the menu. I wonder how much it slows down loading of the pages by visitors to the site. Would moving the DHTML over to a .js file speed things up?

If so, I am a complete novice when it comes to .js. I have read the forums here and I think I have the .js file set up correctly...

deleting everything above "function Go(){return}" and
deleting everything below "function AfterCloseAll(){return}"

but I am not sure what I need to put in my .dwt to properly call the .js.

Here are links to my test pages:
www.littleriverbedandbreakfast.com/indextest.htm
www.littleriverbedandbreakfast.com/lrbbmenubar.js

TIA,
Rob


Senior Advisor
3,910 posts

I'll take a gander by saying-first find where it says "TargetLoc=''; and put the name of the js file there like this.TargetLoc='Irbbmenubar';

then for the menu to be called you'd use

<span id="menu">
<SCRIPT type="text/javascript" SRC="Irbbmenubar.js"></SCRIPT>
</span>
and copy this to every page you want the menu on.. of course i'm only 49% sure :D "It's A Smart Person That Asks"



Trial User
3 posts

Bruzer, thanks for the response, I tried it but it did not solve the issue. I assume TargetLoc is supposed to be inside the js file so it seems redundant to set it to "lrbbmenubar".


Senior Advisor
3,910 posts

hello,
BillR is tyhe expert on this lol, but I'll show you how I do it.
http://kellyinfo.com/MyFiles/tutorials/DhtmlMenu.html "It's A Smart Person That Asks"



Trial User
3 posts

I think that did the trick...perfect and awesome! Thanks and you should have them post this reference video for other newbies like me!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.