469,271 Members | 1,009 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

Javascript - Need to hide Status bar message for links

76
Be it far beyond me as to why but I am merely a worker bee the customer has decided that he doesn't want the links URL to appear in the status bar but instead wants a message like "Click to open" to appear instead.

I've looked up a few different ways but the way I've seen doesn't actually work. I would like code that will work for all links that I can just shove into a global script instead of adding a function to each individual links.

This does NOT work
<script language="javascript">
function hidestatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus
</script>

If I use the hidestatus function in a link that calls it--it does work however is there a way to do this automatically so I don't have to go through five bazillion links?

What works:
<a href="test.aspx" onmouseover="return hidestatus()">Test Page</a>
Jul 11 '06 #1
7 15707
Arielle
76
I've decided to take a different approach. I now call a function from the onload attribute of the function that calls the following.

function hideStatusLinks()
{
var doc = document.body.getElementByTag("a");
for (var x=0;x<doc.length;x++)
{
doc[x].setAttribute("onmouseover",hideLink);
}
}

function hideLink()
{
window.status = "Frogs like teacups";
}


But it -still- doesn't work. If I change the window.status to alert("Frogs"); it works perfectly so I'm starting to wonder about the changing of the status. It's one of those problems that is kicking my butt but I bet tonight I'll suddenly get a eureka.
Jul 11 '06 #2
sashi
1,754 Expert 1GB
Hi there,

the simplest solution is..

example 1..
Expand|Select|Wrap|Line Numbers
  1. <a href="http://www.somewhere.com" onMouseOver="window.status='Some Message Text Here'; return true;">Link Name</a>
  2.  
example 2..
Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2. function writetostatus(input){
  3.     window.status=input;
  4.     return true;
  5. }
  6. </script>
  7.  
usage..
Expand|Select|Wrap|Line Numbers
  1. <a href="http://www.somewhere.com" onMouseover="writetostatus('Some Message Text Here')"
  2. onMouseout="writetostatus('')">Link Name</a>
  3.  
i have been the second example on all my web projects and it works fine.. hope it works fine for you too.. good luck my fren.. :)
Jul 11 '06 #3
Banfa
9,064 Expert Mod 8TB
I think

doc[x].setAttribute("onmouseover",hideLink);

needs to be

doc[x].setAttribute("onmouseover","hideLink();");
Jul 12 '06 #4
Arielle
76
Thanks,

Yeah I knew about that one I was just trying to see if there was a way to dynamically generate it rather than go through all the links on the website. (It's a very large website... )

In the end I just ended up doing a very large search & replace...
Jul 12 '06 #5
iam_clint
1,208 Expert 1GB
<script>
function hidestatus(){
window.status='How ya doin there captain!'
return true
}

document.onmouseover=hidestatus
document.onmouseout=hidestatus
</script>
Jul 15 '06 #6
Hi there,

the simplest solution is..

example 1..
Expand|Select|Wrap|Line Numbers
  1. <a href="http://www.somewhere.com" onMouseOver="window.status='Some Message Text Here'; return true;">Link Name</a>
  2.  
example 2..
Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2. function writetostatus(input){
  3.     window.status=input;
  4.     return true;
  5. }
  6. </script>
  7.  
usage..
Expand|Select|Wrap|Line Numbers
  1. <a href="http://www.somewhere.com" onMouseover="writetostatus('Some Message Text Here')"
  2. onMouseout="writetostatus('')">Link Name</a>
  3.  
i have been the second example on all my web projects and it works fine.. hope it works fine for you too.. good luck my fren.. :)

Hey I was wondering where exactly you should put the codes in at the html. Sorry I'm a newbie at html so was hoping you could help me. Do I put it between <head>? Any help would be appreciated.
Feb 19 '07 #7
acoder
16,027 Expert Mod 8TB
Hey I was wondering where exactly you should put the codes in at the html. Sorry I'm a newbie at html so was hoping you could help me. Do I put it between <head>? Any help would be appreciated.
Welcome to The Scripts.

You can put the javascript code in between the head tags. that should work fine. You can also put it in the body tags. See this page for more information.
Feb 19 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by mark4asp | last post: by
3 posts views Thread by dan baker | last post: by
9 posts views Thread by Ian Shere | last post: by
5 posts views Thread by Boo | last post: by
1 post views Thread by KiSSFRo | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.