SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    341
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What wrong with: var varName=/"<input type="button" onClick="alert('hello');">/"; ?

    How would I put:

    <input type="button" onClick="alert('hello');">

    inside quotes??

    <script>
    varName= "*goes here*";
    </script>

    As obviously I have already used the " and '

  2. #2
    Use The Cloud
    Join Date
    Jan 2006
    Location
    Boise, ID
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. This is a javascript question, not PHP
    2. http://www.google.com/search?q=javascript+escape+quotes
    Brad Hanson, Web Applications & Scalability Specialist
    ► Is your website outgrowing its current hosting solution?
    ► PM me for a FREE scalability consult!
    ► USA Based: Available by Phone, Skype, AIM, and E-mail.

  3. #3
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    341
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    \"

  4. #4
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    <input type="button" onClick="alert(\'hello\');">
    I will agree with other members. Please post in appropriate section

  5. #5
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    var btn = '<input type="button" onClick="alert(/'hello/');">';
    Visit my blog
    PHP && Life
    for technology articles and musings.

  6. #6
    Web Professional
    Join Date
    Oct 2008
    Location
    London
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Hammer65 View Post
    var btn = '<input type="button" onClick="alert(/'hello/');">';
    Almost.

    Code:
    var btn = '<input type="button" onClick="alert(\'hello\');">';

  7. #7
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by decowski View Post
    Almost.

    Code:
    var btn = '<input type="button" onClick="alert(\'hello\');">';
    yes that's right, sorry wrong slashes.
    Visit my blog
    PHP && Life
    for technology articles and musings.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •