In this tutorial we will produce the same output as that earlier example except that this time we will not use a predefined page. Here's the code:
We use document.write statements to generate content for our new web page exactly the same as we would if we were generating output to appear in the current web page. As it is TheNewWin that we want to write the content to and not the current page we use TheNewWin.document.write to reference the write method for that page instead of the current web page.
In this example I have used five separate document.write statements to output the page content. It doesn't matter how many statements that you use as long as the entire output of each statement is contained within a single line.
This article written by Stephen Chapman, Felgall Pty Ltd.