By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,105 Members | 2,620 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,105 IT Pros & Developers. It's quick & easy.

Hide URL in statusbar when mouse over link

P: n/a
I know you can do an onmouseover/onmouseout to display alternate text for
links but Im looking for a script that would cover all links on a page
without having to add code to each link.

Is there such a thing?

I also know lots of people hate it when you do that but this is for an
application which requires IE5.5+ and there is no need for the user to view
the links.

TIA!


Jul 23 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
"Targa" <ta***********************@alltel.net> wrote in message
news:J4***************@fe61.usenetserver.com...
I know you can do an onmouseover/onmouseout to display alternate text for
links but Im looking for a script that would cover all links on a page
without having to add code to each link.

Is there such a thing?

I also know lots of people hate it when you do that but this is for an
application which requires IE5.5+ and there is no need for the user to view the links.

TIA!


Is this what you want?

<style type="text/css">
a { text-decoration:none }
</style>
Jul 23 '05 #2

P: n/a
Thanks but no - that would just keep links from being underlined.

I need to keep the URL of all links from showing up in the statusbar.
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:SdUAd.305580$HA.161123@attbi_s01...
"Targa" <ta***********************@alltel.net> wrote in message
news:J4***************@fe61.usenetserver.com...
I know you can do an onmouseover/onmouseout to display alternate text for
links but Im looking for a script that would cover all links on a page
without having to add code to each link.

Is there such a thing?

I also know lots of people hate it when you do that but this is for an
application which requires IE5.5+ and there is no need for the user to

view
the links.

TIA!


Is this what you want?

<style type="text/css">
a { text-decoration:none }
</style>


Jul 23 '05 #3

P: n/a
"Targa" <ta***********************@alltel.net> wrote in message
news:Vf***************@fe61.usenetserver.com...
Thanks but no - that would just keep links from being underlined.

I need to keep the URL of all links from showing up in the statusbar.
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:SdUAd.305580$HA.161123@attbi_s01...
"Targa" <ta***********************@alltel.net> wrote in message
news:J4***************@fe61.usenetserver.com...
I know you can do an onmouseover/onmouseout to display alternate text for links but Im looking for a script that would cover all links on a page
without having to add code to each link.

Is there such a thing?

I also know lots of people hate it when you do that but this is for an
application which requires IE5.5+ and there is no need for the user to

view
the links.

TIA!


Is this what you want?

<style type="text/css">
a { text-decoration:none }
</style>

Your original post didn't mention the statusbar.

Will one of these work for you?

<html>
<head>
<title>hrefhide.htm</title>
<script type="text/javascript">
function a() {
location.href = "http://www.google.com/";
}
</script>
</head>
<body>
<a href="javascript:a()">Google</a>
<br><br>
<a href="#" onclick="location.href='http://www.google.com/'">Google</a>
<br><br>
<a onclick="location.href='http://www.google.com/'"
style="cursor:hand"><u>Google</u></a>
<br><br>
<a onclick="location.href='http://www.google.com/'"
style="cursor:pointer"><u>Google</u></a>
</body>
</html>
Jul 23 '05 #4

P: n/a


Targa wrote:
Im looking for a script that would cover all links on a page
without having to add code to each link. I also know lots of people hate it when you do that but this is for an
application which requires IE5.5+ and there is no need for the user to view
the links.


Tested with IE 6:

<html lang="en">
<head>
<title>mouseover handler</title>
<script type="text/javascript">
function mouseOutHandler (evt) {
if (typeof evt != 'undefined') {
evt = window.event;
}
window.status = '';
if (evt && typeof evt.returnValue != 'undefined') {
evt.returnValue = true;
}
if (evt && evt.preventDefault) {
evt.preventDefault();
}
return true;
}

window.onload = function (evt) {
if (document.addEventListener) {
document.addEventListener(
'mouseover',
mouseOutHandler,
false
);
}
else if (document.attachEvent) {
document.attachEvent(
'onmouseover',
mouseOutHandler
);
}
};
</script>
</head>
<body>
<p>
Does the status bar show the link URL?
<a href="http://www.example.com/">example</a>
</p>
</body>
</html>

Should work with IE 5.5 too.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #5

P: n/a
Thanks again for the reply.

Hide URL in Statusbar... is the subject of this thread.

The code provided requires modification to each link which wont work for me.
I need a single script that would hide all urls on the page.

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:swWAd.828033$8_6.752314@attbi_s04...
"Targa" <ta***********************@alltel.net> wrote in message
news:Vf***************@fe61.usenetserver.com...
Thanks but no - that would just keep links from being underlined.

I need to keep the URL of all links from showing up in the statusbar.
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:SdUAd.305580$HA.161123@attbi_s01...
> "Targa" <ta***********************@alltel.net> wrote in message
> news:J4***************@fe61.usenetserver.com...
>> I know you can do an onmouseover/onmouseout to display alternate text for >> links but Im looking for a script that would cover all links on a page
>> without having to add code to each link.
>>
>> Is there such a thing?
>>
>> I also know lots of people hate it when you do that but this is for an
>> application which requires IE5.5+ and there is no need for the user to
> view
>> the links.
>>
>> TIA!
>
> Is this what you want?
>
> <style type="text/css">
> a { text-decoration:none }
> </style>

Your original post didn't mention the statusbar.

Will one of these work for you?

<html>
<head>
<title>hrefhide.htm</title>
<script type="text/javascript">
function a() {
location.href = "http://www.google.com/";
}
</script>
</head>
<body>
<a href="javascript:a()">Google</a>
<br><br>
<a href="#" onclick="location.href='http://www.google.com/'">Google</a>
<br><br>
<a onclick="location.href='http://www.google.com/'"
style="cursor:hand"><u>Google</u></a>
<br><br>
<a onclick="location.href='http://www.google.com/'"
style="cursor:pointer"><u>Google</u></a>
</body>
</html>


Jul 23 '05 #6

P: n/a
Thanks Martin - Works great!
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:41***********************@newsread2.arcor-online.net...


Targa wrote:
Im looking for a script that would cover all links on a page without
having to add code to each link.

I also know lots of people hate it when you do that but this is for an
application which requires IE5.5+ and there is no need for the user to
view the links.


Tested with IE 6:

<html lang="en">
<head>
<title>mouseover handler</title>
<script type="text/javascript">
function mouseOutHandler (evt) {
if (typeof evt != 'undefined') {
evt = window.event;
}
window.status = '';
if (evt && typeof evt.returnValue != 'undefined') {
evt.returnValue = true;
}
if (evt && evt.preventDefault) {
evt.preventDefault();
}
return true;
}

window.onload = function (evt) {
if (document.addEventListener) {
document.addEventListener(
'mouseover',
mouseOutHandler,
false
);
}
else if (document.attachEvent) {
document.attachEvent(
'onmouseover',
mouseOutHandler
);
}
};
</script>
</head>
<body>
<p>
Does the status bar show the link URL?
<a href="http://www.example.com/">example</a>
</p>
</body>
</html>

Should work with IE 5.5 too.
--

Martin Honnen
http://JavaScript.FAQTs.com/


Jul 23 '05 #7

P: n/a
"Targa" <ta***********************@alltel.net> wrote in message
news:YE***************@fe61.usenetserver.com...
Thanks again for the reply.

Hide URL in Statusbar... is the subject of this thread.


http://jibbering.com/faq/#FAQ2_3

"Use the Subject: of your post to indicate the type of problem you have, but
include the question in the body aswell."
P.S. I'm glad that you found a solution.
Jul 23 '05 #8

P: n/a
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:41***********************@newsread2.arcor-online.net...


Targa wrote:
Im looking for a script that would cover all links on a page
without having to add code to each link.

I also know lots of people hate it when you do that but this is for an application which requires IE5.5+ and there is no need for the user to view the links.


Tested with IE 6:

Should work with IE 5.5 too.


Below works in Netscape 4, IE 4+, Opera 6+ and Mozilla:

function setAllHrefMOut(f, d, inLayer) {
if (!inLayer) {
d = document;
}

if (d) {

var i;

if (d.links) {
i = d.links.length;
while (i-- > 0) {
if (!d.links[i].onmouseout) {
d.links[i].onmouseout = f;
}
}
}

if (d.layers) {
i = d.layers.length;
while (i-- > 0) {
setAllHrefMOut(f, d.layers[i].document, true);
}
}
}
} // setAllHrefMOut()

Corresponding setAllHrefMOver() could be written as well, or modify the
current function to specify mouseover/mouseout.

Called using:

function myMouseOut() {
// do whatever
return true;
}
setAllHrefMOut(myMouseOut);

Yes, yes, I realized later that I didn't really need to pass "inLayer",
but I was concerned someone would see the method signature and do:

setAllHrefMOut(myMouseOut, document);

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #9

P: n/a

Hi,

I think this is what you are looking for:

Place the following inside the <HEAD> tags...

<script language="JavaScript" type="text/javascript">
function updateStatusBar()
{
window.status = " ";
timerID= setTimeout("updateStatusBar()", 250);

}
</script>

And call the function either with an onload in the BODY tag, or call it
using a seperate javascript call at the very end of your html... thus

..
..
..
..
<script language="JavaScript" type="text/javascript">
updateStatusBar();
</script>
</BODY>
</HTML>

The above loops every 250ms calling the function updateStatusBar which
sets the status bar to a space... Perhaps 250ms is too small - looping
that fast might consume too much CPU on slower machines - don't know -
you'll have to test it.

I hope it helps
randell d.
Targa wrote:
I know you can do an onmouseover/onmouseout to display alternate text for
links but Im looking for a script that would cover all links on a page
without having to add code to each link.

Is there such a thing?

I also know lots of people hate it when you do that but this is for an
application which requires IE5.5+ and there is no need for the user to view
the links.

TIA!

Jul 23 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.