![]() |
Accessing Smarty Variable in Javascript??
Hi,
I'm trying to access an extra field value from within javascript. How can I do this?? Here is what I have if it helps, it's take from the customer/main/product.tpl: I'm trying to Alert( {$v.field_value} ) Code:
{foreach from=$extra_fields item=v} |
Re: Accessing Smarty Variable in Javascript??
moved to X-Cart Customization > Storefront Design & Template Editing in v3.x, 4.0.x, 4.1.x
|
Re: Accessing Smarty Variable in Javascript??
The {literal} ... {/literal} means don't do anything smarty between those tags. You have two choices. Since you don't use any { or } in your javascript you can just remove the {literal} and {/literal}. If you think you might be adding in some ifs where you'll be using { and } you can either leave out the {literal} {/literal} and use {ldelim} and {rdelim} instead { and } in your javascript. Or you can leave in the {literal} {/literal} and change
{$v.field_value} to {/literal}{$v.field_value}{literal}. |
All times are GMT -8. The time now is 11:16 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.