My scenario involves a user who wishes to enter \' in an html input field.
I must then convert that to a javascript variable (for any number of
reasons).
However, when I attempt to escape backslashes then attempt to escape
apostrophes, I end up with a javascript error: Unterminated string constant.
I can see the source on my page has the javascript variable something like:
var name = '\\''.
What are the correct steps to correctly escape data such as \' or any number
of backslashes or apostrophes.
 
Thanks,
Derrick
 
 
 
 
This electronic transmission is strictly confidential to Smith & Nephew and
intended solely for the addressee.  It may contain information which is
covered by legal, professional or other privilege.  If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy or take any action in reliance on this
transmission.  If you have received this transmission in error, please
notify the sender as soon as possible and destroy this message.

Reply via email to