Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

onclick window.location.href won't work in Chrome or Safari

We have a downloads section and we're trying to track when a user downloads something. The downloads are linked as followed:

<a href="DOWNLOADURL" onclick="window.location.href='http://analytics.performable.com/v1/event?_n=EVENTID&_a=PORTALID&email=USEREMAIL'">TITLE OF DOWNLOAD</a>

It works fine in IE and FF but not Chrome (or any webkit browser) or Safari. I can live without Safari but it would be nice.

Any ideas?

like image 803
Aikyrie Avatar asked Apr 20 '12 20:04

Aikyrie


1 Answers

try this:

<a href="DOWNLOADURL" onclick="javascript:window.location.href='http://analytics.performable.com/v1/event _n=EVENTID&_a=PORTALID&email=USEREMAIL'; return false;">TITLE OF DOWNLOAD</a>
like image 133
newtron Avatar answered Sep 30 '22 19:09

newtron



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!