The following code cancels left clicks and middle clicks on the whole page:
<script> $(document).on('click',false) </script>
<a href="http://example.com">link</a>
This other code uses a jquery delegated event to cancel clicks on A
elements only:
<script> $(document).on('click','a',false) </script>
<a href="http://example.com">link</a>
which works fine for left clicks, but if you middle click the link, a new tab is opened, which means the event was not cancelled.
Why using the second code, middle clicks are not cancellled?