Escape single quotes(‘) in JavaScript

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

  1. Umesh Says:

    its really superb…the solution was simple and straight fwd..it 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:

    Hi,

    What if i have like this

    He’s a great man

    In this case, how is the escape sequence work?

    hjhddfjslfdjsjflsjf

    function showtip(text)

    {
    alert(text);
    }

  4. Nischal Shetty Says:

    Hey Anitha… You can do this…

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

    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 to Nischal Shetty Cancel reply