...

View Full Version : Onclick with more than one parameter



Cltornes
09-26-2011, 11:06 AM
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!

Raphael
09-26-2011, 07:22 PM
Try this:

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

blaze4218
09-26-2011, 07:51 PM
you can write your code inside the onclick the same as in the <script></script> (just make sure you have \" for quotes)

Try this:


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

Cltornes
09-28-2011, 10:22 AM
Thanks to both of you. It works :D

Thank you thank you thank you :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum