Syntax for the page generation program:

<head> <title>JavaScript Tutorial: Example 3 Contents</title> <script> // JavaScript functions go here. function DisplayPage() { /* This function will contain the code to generate a new page containing data about the current page. */ // First open a new document. displayWindow = window.open("","WDWindow") // Frame it with appropriate html codes. displayWindow.document.write("<HTML>") displayWindow.document.write ("<HEAD><TITLE>JavaScript Tutorial Display Window</TITLE></HEAD>") displayWindow.document.write("<BODY>") displayWindow.document.write("<h3>Window summary information:</h3>") displayWindow.document.write("The topmost window document is:") displayWindow.document.write(window.top.document.title+"<BR>") displayWindow.document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;") displayWindow.document.write("The parent window document is:") displayWindow.document.write(window.parent.document.title+"<BR>") displayWindow.document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;") displayWindow.document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;") displayWindow.document.write("<STRONG>The current window document is: ") displayWindow.document.write(window.document.title+"</STRONG><BR>") displayWindow.document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;") displayWindow.document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;") displayWindow.document.write("<STRONG>The URL for this document is: ") displayWindow.document.write(window.document.URL+"</STRONG><BR>") displayWindow.document.write("</BODY>") displayWindow.document.write("</HTML>") displayWindow.document.close() } </script> <LINK REL="SHORTCUT ICON" href="http://webdeveloper.com/favicon.ico"> </HEAD> <body> <h3>JS Software's Terrific Page Analyzer</h3> <form onSubmit="DisplayPage()"> <input type="submit" value="Display Page"> <br> </form> <hr> </body>