11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

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.

Figure 12-1: Simple window and its source<br />

It is possible to write out HTML to the newly created window dynamically, so you could use<br />

something like<br />

myWindow.document.writeln("fun");<br />

myWindow.document.writeln("Hi from<br />

<strong>JavaScript</strong>");<br />

just as easily for your document.write() statements. <strong>The</strong> next window creation example shows<br />

how the previous ―Guru‖ example implemented with the alert() method could be modified to<br />

support more customized windows. It is no stretch to create your own form of alerts or other<br />

dialogs in a similar fashion, though setting the dialog to be truly modal would take some extra<br />

manipulation. See the section entitled ―Window Extensions‖ later in this chapter for more<br />

information on this.<br />

<br />

<br />

<br />

<strong>JavaScript</strong> Guru 1.1<br />

<br />

<br />

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

Saved successfully!

Ooh no, something went wrong!