Possible Duplicate:
In Jquery, how can I tell between a programatic and user click?
Depending on the browser, there are several methods by which a link can be "clicked" using javascript.
IE (pre IE9)
element.click(); element.fireEvent('click');
Other browsers use:
element.dispatchEvent(evt) where evt is a mouseclick event.
I want to make sure that actual end user action was the originator of the event on particular links. The technique I use now is to override these methods and filter out click events, but it is easily defeated by reverting the methods back to the prototype versions before using them.
Is there any reliable, cross browser way to determine whether or not a click event is firing as a result of direct user action (they actually clicked the element).