• 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?

#1
[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?

Luc
 

Shadab

Well-known member
#2
Try the jsescape function:
Code:
{xen:jsescape {xen:phrase your_phrase_title}}
You can see more examples in the "editor_js_setup" template.
 
F

Floris

Guest
#4
Try the jsescape function:
Code:
{xen:jsescape {xen:phrase your_phrase_title}}
You can see more examples in the "editor_js_setup" template.
awesome find :) Thanks for posting the answer. Updating a COS forum now using that tip.