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
Can I pass variables to menu_data.js?
-
- Beginner
- Posts: 5
- Joined: Wed Dec 07, 2005 10:10 pm
-
- Beginner
- Posts: 5
- Joined: Wed Dec 07, 2005 10:10 pm
I just realized the easy solution...
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!
http://milonic.com/mfa/2004-July/004567.html
Thanks for a great menu!