|
-
Jan 31st, 2003, 11:33 PM
#1
Thread Starter
Addicted Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|