Re: [SMARTY] BIG PROBLEM - {literal} and parsing vars in JS
| From: | Monte Ohrt | Date: | Sat, 18 May 2002 19:40:28 +0000 |
| Subject: | Re: [SMARTY] BIG PROBLEM - {literal} and parsing vars in JS | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4303@lists.php.net to get a copy of this message | ||
Either escape out of your literal tags each time you want to display a smarty variable, or don't use literal tags, use rdelim and ldelim instead.
<script language=javascript>
function foo () {ldelim}
var blah = {$myvar}
{rdelim}
</script>
Ray wrote:
I have a JS script inside my tpl that Is needing to use variables from the php and smarty but unfortunatly since JS seems to require a {literal} {/literal} around it, its not parsing the data properly. I am not using the {literal} tags simply because i would need countless numbers of them due to the amount of variables we insert into our js. Is there any way around this? Thanks.