|
-
Oct 21st, 2005, 12:46 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Javascript: Escape Apostrophe
Hi,
I would think that this has been asked a thousand times, but I couldn't find a simple way to do this. If my javascript string has an apostrophe (or multiple apostrophes), how do I escape it (them)? I'm doing a SQL lookup based on the string and names like O'Reilly cause my app to choke!
Thanks,
OneSource
-
Oct 21st, 2005, 12:53 PM
#2
Re: Javascript: Escape Apostrophe
-
Oct 21st, 2005, 01:05 PM
#3
Thread Starter
Fanatic Member
mendhak ...
Yea, I know how to escape the character, but I want a function to search the string, locate the apostrophes and return a string with them properly escaped ... In other words, a replace function ....
-
Oct 23rd, 2005, 01:47 AM
#4
Fanatic Member
Re: Javascript: Escape Apostrophe
Maybe you could split the string and then rebuild it with escaped apostrophes? I havn't done much JS in awhile but when I do and I run into a problem I turn to javascript.internet.com looking for source code...
What bug? That's not a bug. It's an undocumented feature!
-
Oct 28th, 2005, 01:57 PM
#5
Thread Starter
Fanatic Member
anotherVBNewbie ...
thanks. I was able to figure it out using the escape function in my *.js file and using the replace function in my VB.Net webservice to replace single quotes with double quotes.
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
|