JavaScript Tutorial/Window/Status Bar

Материал из Web эксперт
Перейти к: навигация, поиск

Assign value to the window status bar (IE)

<html>
<head>
<title>Status Bar Changer</title>
<script language="javascript" type="text/javascript">
<!--
function changeStatus()
{
     window.status=prompt("Message","default message");
}
//-->
</script>
</head>
<body>
<h1>Status Bar Changer</h1>
<P><a href="javascript:changeStatus()">Change Status</a></p>
</body>
</html>


Change window status bar text when clicking a button

<HTML>
<BODY>
<FORM>
<INPUT type="button" value="Change Status!" onClick="window.status="Hey there!";">
<P>
<INPUT type="button" value="Clear Status!" onClick="window.status="";">
</BODY>
</HTML>


Update status bar message in onMouseOver/onMouseOut event

<html>
<head>
<script language="JavaScript" type = "text/javascript">
<!--
function StatusMsg(LinkURL, LinkDesc) {
    if (LinkURL == "") {
       status = " "
    } else {
       status = ("Visit " + LinkDesc + " at " + LinkURL)
    }
    return true
}
//-->
</script>
</head>
<body>
<title>Change Status Message</title>
</head>
<body>
<P><a href="http://www.microsoft.ru"
      onMouseOver="return StatusMsg(this.href, "Microsoft")"
      onMouseOut= "return StatusMsg("","")">Microsoft</a>
</p>
<P><a href="http://www.netscape.ru"
      onMouseOver="return StatusMsg(this.href, "Netscape")"
      onMouseOut="return StatusMsg("","")">Netscape</a></p>
<P><a href="http://www.samspublishing.ru"
      onMouseOver="return StatusMsg(this.href, "Sams Publishing")"
      onMouseOut="return StatusMsg("","")">Sams</a></p>
</body>
</html>