|
-
Jul 27th, 2005, 02:42 AM
#1
Thread Starter
Addicted Member
string problem in server side dynamic javascript
Hi all
Im generating javascript string in the server. the string is depends of variables which stored in datareader. im looping through the darareader (which source is MS access file) and while doing that, generating the Javascript section as string. Then sending the Javascript to the client. my problems begin with fields that has apostrophe, quatations (ex. No', "year" etc) - how can i deal with that.???? and where to deal with that (in the SQL transact, coding store proc., code behind that generates the script??? ....)
Thanks alot
-
Jul 27th, 2005, 04:12 AM
#2
Frenzied Member
Re: string problem in server side dynamic javascript
You need to escape the characters.
'Jim says it's ok' is obviously going to break.
In JavaScript I believe \ is the escape character so:
'Jim says it\'s ok' would work fine.
Does that cover it?
DJ
If I have been helpful please rate my post. If I haven't tell 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
|