15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

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.

150<br />

<strong>JavaScript</strong> <strong>Examples</strong> <strong>Bible</strong>: The Essential Companion to <strong>JavaScript</strong> <strong>Bible</strong><br />

Listing 16-16: Using the self Property<br />

<br />

<br />

self Property<br />

<br />

self.defaultStatus = “Welcome to my Web site.”<br />

<br />

<br />

<br />

Microsoft<br />

Netscape<br />

<br />

<br />

status<br />

windowObject.status<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Compatibility ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓<br />

Example<br />

In Listing 16-17, the status property is set in a handler embedded in the<br />

onMouseOver attribute of two HTML link tags. Notice that the handler requires a<br />

return true statement (or any expression that evaluates to return true) as the<br />

last statement of the handler. This statement is required or the status message will<br />

not display, particularly in early browsers.<br />

Listing 16-17: Links with Custom Statusbar Messages<br />

<br />

<br />

window.status Property<br />

<br />

<br />

Home<br />

Netscape<br />

<br />

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

Saved successfully!

Ooh no, something went wrong!