1. 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"?

Discussion in 'XenForo Development Discussions' started by RickM, Oct 29, 2010.

  1. RickM

    RickM Well-Known Member

    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 :/
     
  2. Mike

    Mike XenForo Developer Staff Member

    <xen:untreated></xen:untreated>
     
    RickM likes this.
  3. RickM

    RickM Well-Known Member

    Ahh great stuff! Cheers Mike :)
     

Share This Page