Single and double quote problem
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   megha_pansari
Posted On:   Monday, March 25, 2002 04:34 AM

Strings that are coming from the database can contain single or double quote characters.
Instead of displaying them straight, Javacsript processes these strings.
Terminates the string as it finds a matching quote where I need to pass each such string to a javascript method for processing.

Will anyone help me in this regard
Thanx
-megha

Re: Single and double quote problem

Posted By:   Jayaprakash_A  
Posted On:   Wednesday, March 27, 2002 02:09 PM

One way I can think of is before giving the string value to the javscript handler, insert the escaping characters. Javascript also supports the same escape characters as C or Java. So, before writing to the HTML, replace all ' with \\' and " with \". I guess this will work.
About | Sitemap | Contact