Escape characters to be used in a javascript literal string -
i take string user enter text box in form , turn javascript literal. i'd, instance, turn " character \".
is there complete list of characters need escaped?
you need escape delimiter and/or whatever enclosing quotes choose (escape double quotes if enclose string in double, escape single otherwise).
if you're going render html, may wnat convert them entities (e.g. & -> &)
Comments
Post a Comment