?
Solved

Hide status bar on IE7

Posted on 2007-07-21
5
Medium Priority
?
2,541 Views
Last Modified: 2012-05-05
Hi, i have a page that display photos.
Each of photo will link to another page. I want to hide the link that appears at status bar.
I'm using this code :
//Hide status bar msg II script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use
      
function hidestatus(){
      window.status=""
      return true
}
      
if (document.layers)
      document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
      
document.onmouseover=hidestatus;
document.onmouseout=hidestatus;

The code can work on Firefox, but it doesn't work on IE 7.
I read an article that mentions IE 7 already took out javascript window.status changes in order to prevent phishing/address spoofing. Is there any way to make the cod work on IE 7?
Can someone help me, pls? Thanks in advance.
0
Comment
Question by:cemplukcute2003
  • 2
  • 2
5 Comments
 
LVL 17

Expert Comment

by:gops1
ID: 19541262
Here is it:

if (document.addEventListener){ //for Mozilla/netscape
      document.addEventListener("mousedown", hidestatus, true);
}else if(document.attachEvent){///for IE
      document.attachEvent("onmousedown", hidestatus);
}else{ //Netscape 4.x versions
      window.captureEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.KEYDOWN);
      window.onclick=hidestatus;
      window.onkeydown=hidestatus;
}
0
 

Author Comment

by:cemplukcute2003
ID: 19541284
Hmm, it still can't work for IE7.
I still can see the link at the status bar.
Why ah?
0
 
LVL 28

Accepted Solution

by:
TName earned 150 total points
ID: 19541870
AFAIK, IE7 doesn't allow setting the status bar text via window.status for Internet and Restricted Zones
unless the option
"Allow status bar updates via script" in the internet Options > Security is enabled:
http://www.sandhills.edu/blackboard/statusbarscript.htm
http://www.csupomona.edu/~ehelp/blackboard/student/step/allow_status_bar.html

See "Status Bar Scripting" (towards the bottom of the page) here:
http://msdn2.microsoft.com/en-us/ie/aa740486.aspx


But a simple workaround like this seems to still work:
<a href="http://www.google.com"  onClick="window.location='http://www.experts-exchange.com'; return false;">A link</a>
0
 
LVL 28

Expert Comment

by:TName
ID: 19541876
>But a simple workaround like this seems to still work:
Well, this of course is no workaround for simply hiding the status bar text.
It's a no-nice way of lying.
0
 

Author Comment

by:cemplukcute2003
ID: 19541900
Yes, I'm agree with you, TName. It's not a nice way to do something like that.
Thanks for the confirmation that you have given me :)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question