| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Include javascript in custom .tpl | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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 |
|||||||
#2
|
|||||||
|
|||||||
Re: Include javascript in custom .tpl
Just put it right in your template:
{literal}<script language='JavaScript'> alert('$txt_message'); self.location='$to_url'; </script>{/literal}
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
|
#3
|
|||||||
|
|||||||
Re: Include javascript in custom .tpl
Awesome, thank you. I got it working, but I'm not versed enough with the constraints of X-Cart-Smarty tags to know whether I will break something in X-Cart. These forums are a great help!
Thanks again, Christine
__________________
______________ version 4.1.9 Gold |
|||||||
|
|||
X-Cart forums © 2001-2020
|