views:

28

answers:

1

Hi, how in javascript insert smarty variables ?

var info = {
us: 'User: {$UserName}',
ad: 'Address: {$Address}',
img: 'Image: {$URL}'
}

And now show: User: {$UserName}, how show values?

For example: User: Peter

Thanks

+2  A: 

Is the code wrapped in a {literal} {/literal} block? This would stop the variables from being filled in.

Fosco