To hide the true destination of a link I’m using the following code:
<a href="http://example.com" onclick="window.location='http://url-i-want-to-hit.com/'; return false;">Click me</a>
However, if I do right-click and then open in new window, it goes to the URL specified in the anchor href tag. I want it to go to the URL specified in the JavaScript.
Is there a way to do this?
All you need is a mousedown handler to fake them out…
And here is a live demo of it working.