Escape single quotes(‘) in JavaScript

I have moved this post to my new Blog. Please click this link to read it.


6 Responses to “Escape single quotes(‘) in JavaScript”

  1. Umesh Says:

    its really superb…the solution was simple and straight helped me a lot….

  2. Nischal Shetty Says:

    Hey there Umesh….I’m so glad that this post was of some help to you…. If at any point of time you do not understand any post or have any other Javascript related problems do leave a comment… It would be my pleasure to help you out 🙂

  3. anitha Says:


    What if i have like this

    He’s a great man

    In this case, how is the escape sequence work?


    function showtip(text)


  4. Nischal Shetty Says:

    Hey Anitha… You can do this…

    var text = ‘He\’s a great man’;

    Was this what you really had a doubt on? You can tell me the exact scenario if you’re still facing problems… I’ll try my best to help you out. ;o)

  5. Preethi Says:

    If the text value(with \’) is passed to the database, say MSSQL, it is not returning any value.

  6. laxmikanth Says:

    Hi, i am getting javascript issue with single quote in french translation value mots-clés ou appellation d’emploi. can you please help me to resolve the issue. i have tried with (\) back slash , but it was not resolved.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: