• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Variables inside Javascript? Any "safe tags"?

RickM

Well-known member
#1
I'm doing some customizations for my site, however need to basically use variables I'm pulling from my controller inside a piece of javascript which is in the template.

To give you an example, one of my lines is:

Code:
$("#rate-visual").animate({width: "66%"}, 1000);
66% will be replaced with {$visual}% however obviously if I place that in there it wont work (or the JS wont work) because the system will be confused between JS and variables (unless something special exists :p).

Does Xen have 'safe tags' (e.g smarty has {literal} {/literal} to place around javascript) to help with this?

I'm sure I saw something a while back about this but cant for the life of me find it now :/