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

Is there a javascript escape function for phrases?

Discussion in 'XenForo Development Discussions' started by Luciano, Nov 30, 2010.

  1. Luciano

    Luciano Member

    [EDIT] oops :oops: sorry, wanted to post in Development Questions Could you please Move It ( if I delete it it seems the title remains[/Edit]

    Hi, is there a special function to escape javascript phrases? (specially translated phrases)

    I mean when you assign xenforo phrases to javascript variables in templates,
    there used to be a function escape_js($phrase) to handle quotes or special utf-8 characters.

    My question is, is there something similar in xenforo?

  2. Shadab

    Shadab Well-Known Member

    Try the jsescape function:
    {xen:jsescape {xen:phrase your_phrase_title}}
    You can see more examples in the "editor_js_setup" template.
    Floris likes this.
  3. Luciano

    Luciano Member

    Thank you very much .. I looked in many, but missed that one..
  4. Floris

    Floris Guest

    awesome find :) Thanks for posting the answer. Updating a COS forum now using that tip.

Share This Page