I was dealing with a Javascript problem that is tracking when a user clicks on a link (in case you are interested, here it is: Why does using target = "_blank" cause Javascript to crash? ).
I realized that I can solve the problem by tracking the onMousedown event, not the onClick event.
I am curious about the disadvantages of this approach. The ones I can think of:
- If the user clicked on the link and then moved the mouse from the link before it was released, then the event will be recorded even if the user has not visited the link
- If the user used the tab key to move the browser focus to the link, and then press the enter key, the click will not be recorded.
None of them are common, so I donβt really care about them.
Are there any other shortcomings that I am missing?
javascript javascript-events onmousedown onclick
Jack7890
source share