My strings will hold the values:
"["
"[/blah]"
do I need to escape anything?
Is it just doubling the /?
My strings will hold the values:
"["
"[/blah]"
do I need to escape anything?
Is it just doubling the /?
Escape for what purpose? I at least don't see any XSS risks in the particular string.
If your string are "[" "[/blah]"
, then you don't need to escape anything if you use single quote:
var foo = '"[" "[/blah]"';
Since this is a literal string square brackets or forward slash will not be interpreted so in your example you don't need to escape anything. Doubling applies to a backward slash only \