HTML - overRide statusbar link location display

2019-06-25 04:34发布

when on Mouse Over state on a link the status bar shows the link's location in the status bar like in the following image... is there a way to change\override this to show some desired text...

alt text

5条回答
闹够了就滚
2楼-- · 2019-06-25 05:04

This should work

<a href="/www.example.com/contact.html" onmouseover="window.status='Contact'" onmouseout="window.status=''">
查看更多
ゆ 、 Hurt°
3楼-- · 2019-06-25 05:16

In ie9 method 1 does not have any effect. Method 2 also defeats the purpose of concealing info, by placing active file path in status bar, rather than customary interpolated uri:

C:\\\filepath\server\local\whatever

Perhaps there is a way to use method 2. Possibly a proxy link-file location intercept. For example:

<a href="nothinghere" onclick="location.href='anylink';return false">click here</a>

where c:\links\anylink links to c:\private\privatefile ...?

Further: 'Con: can't open link in new tab / new window' ... javascript?

查看更多
SAY GOODBYE
4楼-- · 2019-06-25 05:19

Most browsers will block attempts to change the status line by default for security reasons (phishing).

You can try it anyway:

<a href="link" onmouseover="window.status='your text';" onmouseout="window.status='';">link here</a>

A second approach:

<a href="your text" onclick="location.href='your url';return false">link here</a>

Con: you can't open it in a new tabblad / window using Ctrl + click for example.

查看更多
Emotional °昔
5楼-- · 2019-06-25 05:19

onmouseover or JavaScript are removed from ckeditor of blog sites when we try to input to a page more data next time. So I think, this method should work tested by me in Firefox browser.

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.btn { border:none; }
</style>
<form action="your url"> <input type="submit" class="btn" value="link here">
</form>
</body>
</html>
查看更多
不美不萌又怎样
6楼-- · 2019-06-25 05:20

If you must change the status, here is a cross browser solution that works:

<a href=".: This a link" onClick="window.location='myurl.html';return false">

Downside is that it requires Javascript

Change "This is a link" to required text" and change "myurl.html" to the path of the window file.

If you need to open a url using "_blank" you can create a function that opens a new window instead.

Unfortunately ".:" has to appear at the front of the text otherwise it will render as a url. Tested in IE9. (Firefox and other browsers render this differently

For other browser you could alternatively use "link:" then your url. Tested in Firefox.

NB: you can only change window.status for Opera, (and possible IE 6 and earlier), for security reasons as mentioned in other people's suggestions.

查看更多
登录 后发表回答