As an XF noob I'm still fumbling here so please don't hurt me
I have a bit of Javascript embedded in a template (designed to copy some text, including usernames, to the clipboard).
It worked really nicely until somebody with an apostrophe in their username came along and broke it.
Mike's post here worries me a bit:
Is there some kind of simple solution to this, that will allow me to have a username inside a bit of Javascript without fear of it breaking because of the characters in the username itself?
I have a bit of Javascript embedded in a template (designed to copy some text, including usernames, to the clipboard).
It worked really nicely until somebody with an apostrophe in their username came along and broke it.
Mike's post here worries me a bit:
because even if I find the documentation for the jsEscape helper mentioned here:There aren't character limits by default.
(I can't currently find it despite searching the forum) I'm guessing it's still going to be tricky to escape an arbitrary set of single and double quotes, along with who knows what else by way of fun characters.For reference:
XenForo_Template_Helper_Core::jsEscape
Is there some kind of simple solution to this, that will allow me to have a username inside a bit of Javascript without fear of it breaking because of the characters in the username itself?