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.

Chapter 2 ✦ Window and Frame Objects (Chapter 16)<br />

Listing 16-8: Showing Various Window Properties<br />

<br />

<br />

Window Revealer II<br />

<br />

function gatherWindowData() {<br />

var msg = “”<br />

msg += “From the point of view of this frame:”<br />

msg += “window.frames.length: “ + window.frames.length + “”<br />

msg += “window.name: “ + window.name + “”<br />

msg += “From the point of view of the framesetting document:”<br />

msg += “parent.frames.length: “ + parent.frames.length + “”<br />

msg += “parent.frames[0].name: “ + parent.frames[0].name<br />

return msg<br />

}<br />

<br />

<br />

<br />

<br />

document.write(gatherWindowData())<br />

<br />

<br />

<br />

Figure 2-1: Property readouts from both frames loaded from Listing 16-7<br />

137<br />

windowObject.frames

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

Saved successfully!

Ooh no, something went wrong!