I've been dealing with a bane-of-my-existence Javascript problem involving tracking when a user clicks on a link (in case you're curious, here it is: Why does using target="_blank" cause Javascript to fail?).
I've figured out that I can solve the problem by tracking an onMousedown
event rather than an onClick
event.
I'm curious about the downsides of this approach. The ones I can think of:
Neither of these are common, so I'm not terribly worried about them.
Are there any other downsides I'm missing?
One more: mousedown captures right / middle clicks too.
But for your two reasons, I would stick to onclick
. I know quite a few people who use keyboard nav. Especially search-and-gotolink in FF.(/ to search followed by enter to go to the link).
But if these two are not a problem for you, I think right / middle clicks wouldn't be too.
I think the way to track all the users who follow the link is quite tricky -- the user could right click and click on new tab / new window...