Passing Information
from the Parent Window to the Child Window

<SCRIPT>

/* opens a new window, set its parameters, & assigns it to the variable newWindow */

newWindow = open('', 'newWin',
        'toolbar=yes,location=yes,scrollbars=yes,resizable=yes,width=300,height=300')

/*
here the script is writing into the document window represented by newWindow the HTML headers the first part of the page body
*/

newWindow.document.write("
<HTML>
<HEAD><TITLE>Generated Window</TITLE></HEAD>
<BODY BGCOLOR=WHITE>
<H2>This window shows the result from the other window</H2>"
);

/*
this loop generates numbers from 0 to 99, these number are written to the child window as part of the document
*/

for (i = 0; i < 100; i++) {
     newWindow.document.
write("<BR>The loop is now at: " + i);
}

/* this closes the HTML page */

newWindow.document.write("
</BODY>
</HTML>"
);

/* once everything has been completed close the document window */

newWindow.document.close()

</SCRIPT>

<BODY>

<H1>This window is looping madly!</H1>