View Single Post
  #1  
Old 02-11-2009, 05:51 AM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Include javascript in custom .tpl

How do I include javascript into a custom mod.

Can I place the entire javascript and form within my custom .tpl with {literal} before and after <script> to make this work, or is there a best X-Cart/Smarty practice to accomplish this?

I've looked around in other .tpl and I found <script type="text/javascript" src="{$SkinDir}/folder/jsname.js"></script> into the top portion of the .tpl by spliting the script from the form and uploading the script to the appropriate folder. I've tried adding {include file="folder/jsname.js"} to call out that .js file, but no cigar. Also, I looked in an include/???.php file and found:
<script language='JavaScript'>
alert('$txt_message');
self.location='$to_url';
</script>

Would this mean that I need to create a .php file for the javascript and form that I want to use?

Christine
__________________
______________
version 4.1.9 Gold
Reply With Quote