O'Reilly logo

JavaScript™ 1.5 by Example by Kathie Kingsley-Hughes, Adrian Kingsley-Hughes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example 6—Scrolling Status Bar Message

Another common JavaScript-powered effect is the scrolling message in the status bar of the browser. It's a great way to pass small amounts of information to the visitor without having to resort to alert boxes. Even though the status bar is small and unobtrusive, it is still effective.

Here is a simple example that places a little information in the status bar when the user moves the mouse over an image hyperlink:

<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!-- Cloaking device on!
function addMsg()
{
window.status="Sample image";
return true;
}
// Cloaking device off -->
</script>
</head>
<body>
<a href="moveon.htm" onMouseover="window.status='Sample image'; return true"

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required