Possible Duplicate:
How can I capture the right-click event in JavaScript?
I have links that, when clicked, execute some javascript code. Just like this:
<script>
        function myFunction(){
            alert("Hello World!");
        }
</script>
<a href="http://google.com" onclick="myFunction()">Click</a>
When I do "Right click -> Open in a new tab" it directs me to 'google.com' without calling myFunction(). And that's exactly what I want.
The problem shows up when I open the link in new tab by pressing the link "Ctrl+Left click". This way, it executes myFunction() and then goes to google.com.
Is there any way to fix this?
 
     
    