Javascript howto question

Discussion in 'JavaScript' started by rockout, Apr 26, 2007.

  1. #1
    Alright, so I've written a code that adds code into a textbox when clicked and a php looper so it grasps it from mysql and puts all of it's functions up correctly. It works correctly, I'm just not a very deep javascript coder and I will run into a problem if I can't figure out how to fix this one part.
    <a onclick="insertText('{code}')"
    Code (markup):
    It works fine for one line of code but it will be needed to insert php codes which will be multiple lines of code. Can anyone think of a way for me to have the link insert multiple lines of code and still work? Maybe putting the code into a variable and printing it out from there? I am going to try to stay in one line for all of it but that can't last too long.

    Thanks in advanced,
    Ed
     
    rockout, Apr 26, 2007 IP
  2. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I would need to see all your code, but I believe you mean escaping quotes.
    Like \" and/or \'
     
    bobby9101, Apr 27, 2007 IP