#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Location
    Enschede, The Netherlands
    Posts
    31
    Rep Power
    12

    3 quotes with javascript


    Is there a way to use a third quote in javascript?
    1='
    2="
    3=?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Posts
    1,882
    Rep Power
    19
    Why would you need 3 quotes?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Location
    Enschede, The Netherlands
    Posts
    31
    Rep Power
    12
    example:
    document.write("<INPUT type='button' value='OK' onclick='somefunction("string")'>");

    I noticed that (in IE) I didn't need to put the somefunction() between quotes, when I didn't want to send a string between the (). So: onclick=somefunction(1) works ok, while onclick=somefunction("string") gives an error.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Location
    Inside the GNU/Hurd kernel
    Posts
    492
    Rep Power
    12
    You need to escape the quotes:
    document.write("<INPUT type=\"button\" value=\"OK\" onclick=\"somefunction('string')\">");
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Location
    Enschede, The Netherlands
    Posts
    31
    Rep Power
    12
    Thanx!

IMN logo majestic logo threadwatch logo seochat tools logo