Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2011
    Posts
    15
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Onclick with more than one parameter

    Hi

    I am in doubt if im doing this correct. I have a TD which I have a onclick and a google event tracking code on. But om not shure if I have set it up correct. The () and the , might be wrong..?

    <td class="Content_TD" onclick="(window.open('http://www.google.com/')), (_gaq.push(['_trackEvent', 'navigation', 'link', 'event']));">


    Thanks in advance!

  • #2
    New Coder
    Join Date
    Mar 2009
    Posts
    74
    Thanks
    3
    Thanked 3 Times in 3 Posts
    Try this:

    window.open('http://www.google.com/');_gaq.push(['_trackEvent', 'navigation', 'link', 'event']);

  • Users who have thanked Raphael for this post:

    Cltornes (09-28-2011)

  • #3
    Regular Coder
    Join Date
    Apr 2005
    Location
    Texas
    Posts
    448
    Thanks
    24
    Thanked 63 Times in 63 Posts
    you can write your code inside the onclick the same as in the <script></script> (just make sure you have \" for quotes)

    Try this:
    Code:
    <td class="Content_TD" onclick="window.open('http://www.google.com/'); _gaq.push(['_trackEvent', 'navigation', 'link', 'event']);">

  • Users who have thanked blaze4218 for this post:

    Cltornes (09-28-2011)

  • #4
    New Coder
    Join Date
    Jun 2011
    Posts
    15
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Thanks!

    Thanks to both of you. It works

    Thank you thank you thank you


  •  

    Posting Permissions

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