tags:

views:

74

answers:

3

I already read many article about this issue in here, SO.

I just want to discuss how to do it. NOT the moral issue.

--

for example.

at the google search webpage.

before I click the link, the link does not indicate the google url.

but After I click the link with shift-key, the url on the status bar is changed.

this mean the google webpage indicate 'Fake URL'.

the google compressed script is too difficult to read and analyze.

#

edited

The second url should work on ie8 even if I click with ctrl key.

+1  A: 
<a href="http://this-url-will-be-shown/" onclick="location.href='http://this-url-will-be-opened/'; return false;">Click me</a>
David Hedlund
thank you, but it may not work 'click + ctrl' on ie8
sunglim
A: 

You use javascript to change the status in the window:

window.status='Your Message Here';

You would attach this to some event (onmouseover)

For example:

<A HREF="http://www.stackoverflow.com" onMouseOver="window.status='http://www.google.com'; return true"></A>
Bryan Denny
this does not work on my ie8
sunglim
+1  A: 

The browser always shows link's href-attribute (no way to fake this), but you can capture the click event for link and do whatever you want. An example using jQuery:

$('a').each(function() {
    $(this)
        .attr('orig_href', $(this).attr('href'))
        .attr('href', 'http://google.com');
}).click(function(e) {
    e.preventDefault();
    window.location.href = $(this).attr('orig_href');
});
jholster
as of 1.4, you don't have to `each` that: http://jsbin.com/eyuvo3/2/edit
David Hedlund
Thanks for pointing out.
jholster