18.04.2016 Views

Professional JavaScript For Web Developers

javascript for learners.

javascript for learners.

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>JavaScript</strong> in the Browser<br />

The Statusbar<br />

Figure 5-9<br />

Normally, the status bar tells the user when the page is loading and when it has finished loading; however,<br />

it is possible to set its value using two properties of the window object: status and defaultStatus. As<br />

you may have guessed, status changes the status bar text for a moment while defaultStatus changes it<br />

as long as the user is on the page. <strong>For</strong> example, you may use a default status bar message when the page<br />

first loads:<br />

window.defaultStatus = “You are surfing www.wrox.com. “;<br />

You may also want to display information about a certain link when the user moves the mouse over it:<br />

Books<br />

This is especially useful when using a <strong>JavaScript</strong> URL because browsers, by default, display the value of<br />

the href attribute in the status bar when the user mouses over. Setting window.status can keep the<br />

details of the link implementation from users:<br />

145

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!