Preventing javascript generated clicks on link
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6674669/in-jquery-how-can-i-tell-between-a-programatic-and-user-click">In Jquery, how can I tell between a programatic and user click?</a>  </p>
</blockquote>



<p>Depending on the browser, there are several methods by which a link can be "clicked" using javascript.</p>

<p>IE (pre IE9)</p>

<p>element.click();
element.fireEvent('click');</p>

<p>Other browsers use:</p>

<p>element.dispatchEvent(evt) where evt is a mouseclick event.</p>

<p>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.</p>

<p>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).</p>
