PRB: Moving Mouse Over Anchor Shows Entire URL

ID: Q185532


The information in this article applies to:


SYMPTOMS

Moving the mouse cursor over an Anchor tag that has a Fragment Identifier in the URL causes the entire URL to be displayed in the status bar.

Expected behavior: In Internet Explorer, 3.02 only the Fragment Identifier would be displayed rather than the entire URL.


RESOLUTION

You can change URL information displayed in the status bar using the window.status property. A sample of using this method is shown in the MORE INFORMATION section below.


STATUS

This behavior is by design.


MORE INFORMATION

Workaround

Create a Web page with the following content:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function showStatus(text)
{
window.setTimeout("window.status='" + text + "'", 1);
}
</SCRIPT>
</HEAD>
<BODY>
<A HREF="http://www.microsoft.com#somewhere">Link 1</A>
<A HREF="http://www.microsoft.com#somewhere"
  onmouseover="showStatus('#somewhere')"
  onmouseout="window.status=''">
Link 2</A>
</BODY>
</HTML> 
As the mouse hovers over the text "Link1", the status bar shows the URL:
http://example.microsoft.com#somewhere
As the mouse hovers over the text "Link2", the status bar shows the Fragment Identifier:
#somewhere
In Internet Explorer 4.0 you could just set the status bar text directly in the onmouseover event, as follows:

<A HREF="http://www.microsoft.com#somewhere"
  onmouseover="window.status='#somewhere'"
  onmouseout="window.status=''"> 
However, Internet Explorer 5.0 incorrectly overrides the text in status bar with the hyper-link regardless of the value contained in the window.status property. Setting window.status after a short delay in setTimeout works around the problem.

Microsoft has confirmed this to be a problem in Internet Explorer 5.0.


REFERENCES

For more information, please see the MSDN Web Workshop:

http://msdn.microsoft.com/workshop/default.asp

Additional query words:


Keywords          : kbnokeyword kbIE400 kbIE401 kbIE500 
Version           : 
Platform          : 
Issue type        : kbprb 

Last Reviewed: May 7, 1999