Alvi
Alvi

Reputation: 99

Dont want to show address in the status bar while hovering a link

How can I prevent showing web address at the status bar while hovering a hyperlink?

Upvotes: 4

Views: 18356

Answers (3)

Quentin
Quentin

Reputation: 943630

There is no way to reliable do this, and no point in doing it either.

Any information the user could get out of the status bar is available to them through other methods, so it can't add security.

If you are worried about aesthetics, then the majority of people who would look at it are more likely to be annoyed by the absence of the normal status information then they would be the URI appearing 'ugly'.

If you really want to try to do this, you can look at window.status. Happily, most modern browsers allow this feature to be blocked.

Firefox, for example, blocks it by default:

This property does not work in default configuration of Firefox and some other browsers: setting window.status has no effect on the text displayed in the status bar. To allow scripts to change the the status bar text, the user must set the dom.disable_window_status_change preference to false in the about:config screen.

Upvotes: 3

Peter
Peter

Reputation: 2802

You could change your hyperlink to use JavaScript to navigate to the URL. For example, if you wanted a link to http://conglomo.co.nz/:

<a href="javascript:;" onclick="location.href='http://conglomo.co.nz/'">Conglomo</a>

Although this is not as pretty as changing window.status (which does not work for everyone due to browser settings) it will hide the URL from the status bar completely.

Upvotes: 8

Sarfraz
Sarfraz

Reputation: 382756

You need javascript for that, not php, you can use onMouseOver and window.status like:

<a href="address" onMouseOver="window.status = ''">A Link</a>

Note: It is not a good practice and adept people can find it out easily.

Upvotes: 1

Related Questions