how to handle single quotes
Hi all,
I'm fairly new to javascript. Just started to learn today. I'm having an error due to this single quotes. The string I'm passing contains single quotes. What I wanted is to have it 'escaped' so that it will pass the same value. I wanted to retain its original value.
For example, my string contains MEN'S SHOES. I understand that this should be passed as MEN\'S SHOES. But my string is in a variable. I now can get the location of the (') using indexof. The problem is how to insert the backslash.
Please help me.