SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Git-R-Done
    Join Date
    Nov 2001
    Posts
    1,194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why Doesn't My onClick Work in Table?

    I've used this script before on previous sites but for some reason it keeps coming up with a JS error whenever the page loads. Does anybody see what's wrong with it?

    [inside head tags]

    <script language="JavaScript" type="text/javascript">
    function changeLoc(address){
    window.location.href = address;
    }
    </script>

    [inside table or td tag]

    onclick="changeLoc('index.html', "123");"
    John Saunders

  2. #2
    Git-R-Done
    Join Date
    Nov 2001
    Posts
    1,194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind, it was those freakin double quotes.
    John Saunders


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
  •