easy quiestion, need quick answer, echo, javascript and quotes

Discussion in 'PHP' started by SiLvER, Oct 10, 2010.

  1. #1
    I have this code

    echo '<td onclick="$(\'#response\').html(\'<table><tr><td background=#bbbbbb>IDNo: '. $pkmn['id'] .' example ... </td></tr></table>\';)">some more code</td>';
    PHP:
    What quotes can I use to make "example" a link where otherwise I would use
    <a href="http://www.google.com">example</a>
    Code (markup):
    ?
     
    SiLvER, Oct 10, 2010 IP
  2. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #2
    
    echo '<td onclick="$(\'#response\').html(\'<table><tr><td background=#bbbbbb>IDNo: '. $pkmn['id'] .' <a href=\\\'http://www.google.com\\\'>example</a> ... </td></tr></table>\';)">some more code</td>';
    
    PHP:
    This should work nice.
     
    ThePHPMaster, Oct 10, 2010 IP
  3. SiLvER

    SiLvER Well-Known Member

    Messages:
    610
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Why didn't I think of that??? Thanks a lot dude!
     
    SiLvER, Oct 10, 2010 IP