Can I pass variables to menu_data.js?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
jlkventures1
Beginner
Beginner
Posts: 5
Joined: Wed Dec 07, 2005 10:10 pm

Can I pass variables to menu_data.js?

Post by jlkventures1 »

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
jlkventures1
Beginner
Beginner
Posts: 5
Joined: Wed Dec 07, 2005 10:10 pm

I just realized the easy solution...

Post by jlkventures1 »

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://milonic.com/mfa/2004-July/004567.html

Thanks for a great menu!
Post Reply