View Single Post
  #1  
Old 07-16-2007, 06:53 AM
 
AgentBristow AgentBristow is offline
 

Advanced Member
  
Join Date: Jun 2007
Posts: 36
 

Default Help adding basic javascript code to /customer/home.tpl

I am trying to add the following small piece of Javascript to /customer/home.tpl so I can have a jump menu on the page:

<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>


However it doesn't work. When I view the source code of the live page for some reason xcart keeps changing the code to:
<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore)//-->
</script>

Even if I place the code just before the </head> tag. Why does it do this? Where should or could I put this code so that xcart wont stuff it up?

Thanks!



ON EDIT: I just tried another more basic javascript and it did the same thing! Changed this:
<script type="text/javascript">
function changepage(obj) {
window.location.href = obj.value;
}
</script>

to this:
<script type="text/javascript">
function changepage(obj)
</script>
__________________
Xcart Version 4.1.9 [win]
Reply With Quote