quotation mark

Discussion in 'JavaScript' started by oo7ml, Jul 8, 2007.

  1. #1
    Hi i have a message hint popping up when you hover over one of my text fields on my form. However if i use a ' in my message it won't work becasue it thinks it is the end of my message i.e.

    'this will work'

    'this won't work'

    how do you escape a ' in javascript
     
    oo7ml, Jul 8, 2007 IP
  2. oo7ml

    oo7ml Well-Known Member

    Messages:
    656
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #2
    solved... thanks

    \'
     
    oo7ml, Jul 8, 2007 IP
  3. nabil_kadimi

    nabil_kadimi Well-Known Member

    Messages:
    1,065
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    195
    #3
    This works fine when the text is static, but if it's dynamic, you should convert quotes to html entities... I guess
     
    nabil_kadimi, Jul 9, 2007 IP