Who is online? 124 guests and 0 members
Member login | Become a member
home » blogs » vivek_iit » Error using single quote in Javascript
posted 3/4/2008 by vivek_iit
A junior developer in our recent project got stuck in this issue: he had to call Javascript code from VB.NET code behind and insert this value in a function: Jammin' Hard. Now the single quote (apostrophe ') was creating trouble, giving an error as JS string got terminated. A simple solution in such cases is to use HTML codes for apostrophe, which is : ' So the string should be passed as: Jammin' Hard This solved his issue. See this table for more codes: http://www.netlingo.com/tags.cfm
vivek_iit (Member since: 11/27/2008) I am one of the administrators at CodeAsp.Net and I love programming, architecting solutions, code reviews, teaching and writing about ASP.NET.
View vivek_iit 's profile
Comment (No HTML)
It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.
enter your email address: