Using AJAX with a simple makeRequest for a file, how can I escaped single quotes?

Discussion in 'JavaScript' started by 123GoToAndPlay, Feb 26, 2007.

  1. #1
    Hi all,

    I am using a simple makeRequest, like

    
    <a href="#showContent" onClick="makeRequest('preface.php?nocache=<?php echo time();?>','showContent')">Preface</a>
    
    Code (markup):
    In preface.php I have text, like world's. But it becomes world?s in layer showContent??

    How can I escaped single quotes?
     
    123GoToAndPlay, Feb 26, 2007 IP
  2. bigrollerdave

    bigrollerdave Well-Known Member

    Messages:
    2,112
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    140
    #2
    Have you tried this?

    world\'s
     
    bigrollerdave, Feb 26, 2007 IP