Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a javascript which pop-up a box when mouseover a specific object. The pop-up box will show up the text(or string) pass in. Since Javascript treat ('), (") and (\) as special character. Therefore I use following:

strNote = Replace(DV(i).Item("schNote"), "\", "\\")

to fix up the string before pass in to the Javascript function. The pop-up box show properly.

 

However, the strNote = Replace(DV(i).Item("schNote"), "\", "\\") cannot handle ("). How should I modify it to make it right?

 

Many thanks.

Posted

If I understand you correctly you're wanting to "encode" double quotes in strings within your VB.Net code to the proper escape sequences for javascript.

 

If this is, in fact, what you want to do try something like:

 

strNote = Replace(DV(i).Item("schNote"), """", "\""")

 

Paul

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...