Don't show URL of link in status bar

ellescuba27

Member
Messages
273
Reaction score
3
Points
18
This script uses only CSS and HTML to create a link that doesn't show in the status bar. I have seen many people attempt to use the <a> tag and use Javascript to cover it up, but it doesn't work in newer browsers. Here is a script that will use a <span> tag along with some CSS to make it look like a link.

CSS:
Code:
<style type="text/css">
.spanlink {
color: blue;
cursor: pointer;
text-decoration: underline;
}
a:visited {
color: blue;
}
a:active {
color: blue;
}
</style>

HTML:
HTML:
<span onClick="location.href='url.html';" class="spanlink">This is a link! But you won't see any url, no no. That's because I'm not using the &lt;a&gt; tag!</span>

And putting them together on a page will result in a link that doesn't show it's URL in the status bar! You can even make a hidden link this way! Just remove all the CSS and the class attribute on the <span> tag in the HTML!

The colour of these links will not change if it's visited. I would have to be able to detect which sites you have gone to with Javascript, and while this script is useful, history detection is competitive and mean. So sorry, but I simply won't do that :( . The best you can do (which I have already done just in case) is make real <a> tags look not visited.

Free to use!

Sources:
Me for the html
http://snipplr.com/view/20014/ for the link disguising
 
Last edited:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
The links won't be followed by search engine spiders and will cause problems for screen readers and other tools used by people with disabilities, as would any sort of link that requires JS. HTML is for more than how browser render it; it carries meaning (except for <span> and <div>, which are intentionally free from semantics). Don't break the web.

Unobtrusive JavaScript is a better approach, but even the idea of hiding link URLs is a bad one, needlessly taking away information from users. Myself, I wouldn't use a site that employed such tactics. Most browsers these days don't even show the status bar by default, so I don't see why hiding link URLs is necessary.
 
Last edited:
Top