| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
{literal} or no {literal} with Javascript code? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
{literal} or no {literal} with Javascript code?
For the past three months, I've had a StatCounter code placed within my home.tpl, like this:
Code:
How do you explain it, if every forum I go to, I read that in order for the javascript to work inside a .tpl file, you must surround it with {literal}{/literal} tags. Tonight, I placed those tags around my javascript, and the stats I'm getting don't differ from the ones from yesterday, a week ago, and two months ago. It seems to me those tags are optional, at least in my case... I woul really like to have an explanation for this behaviour - or did I miss something? Thanks, Jack
__________________
Jack@AquasanaCA X-CART GOLD 4.0.19 Live DSEFU, AOM, ezCheckout, ezUpsell, ezRecommends, RememberMe, RememberAnonCarts AquasanaCanada.com - Aquasana╝ - #1 Rated Water Filters in America! X-CART GOLD 4.4.5 Live CDSEO Pro v. 1.8.4 AquasanaMontreal.com Aquasana╝ & Rhino Water Filtration Systems |
|||||||||
#2
|
|||||||||
|
|||||||||
Re: {literal} or no {literal} with Javascript code?
You don't technically need it around all JavaScript. Just JavaScript that has brackets {} that will interfere the Smarty parsing engine. However, most code does have {}, so you generally need the {literal} tags.
|
|||||||||
#3
|
|||||||||
|
|||||||||
Re: {literal} or no {literal} with Javascript code?
That makes sense, as the StatCounter code snippet doesn't have the {} braces.
Thanks for the explanation.
__________________
Jack@AquasanaCA X-CART GOLD 4.0.19 Live DSEFU, AOM, ezCheckout, ezUpsell, ezRecommends, RememberMe, RememberAnonCarts AquasanaCanada.com - Aquasana╝ - #1 Rated Water Filters in America! X-CART GOLD 4.4.5 Live CDSEO Pro v. 1.8.4 AquasanaMontreal.com Aquasana╝ & Rhino Water Filtration Systems |
|||||||||
|
|||
X-Cart forums © 2001-2020
|