Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:08

Can I pass variables to menu_data.js?


Poster: jlkventures1
Dated: Wednesday April 19 2006 - 21:52:10 BST

I am trying to set a var in the <HEAD> tags of my page:
<SCRIPT language="JavaScript" type="text/javascript"> >
<!--
section = "<?php echo($section);?>";
//-->
</SCRIPT>


in menu_data.js, I have:

if (section == "business") {
subStyle.oncolor="#B41D16";
}
subStyle.bgimage='/images/' . section . '-menu-background-solid.gif';

How can I get my JS code in menu_data.js to execute?

Thanks!

Jim

I just realized the easy solution...


Poster: jlkventures1
Dated: Wednesday April 19 2006 - 22:27:18 BST

I will rename menu_data.js to menu_data.php and access my variables directly. It's cleaner, and I saw it in this thread:
http://www.milonic.com/mfa/2004-July/004567.html

Thanks for a great menu!