Previous Example-|-Next Example-|-Return to Chapter Listing

Example 14.7:
Opening and Writing to a Window


Click here to open a window and write HTML to it:

Click here to close the other window:


This is the script we used. In the HEAD... <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- function OpenWindow() { Win1 = open("window.htm","SecWin","scrollbars=yes,width=350,height=230"); var sText = "<BODY>This is some text<P></BODY>" Win1.document.write("<H2>Secondary window</H2><HR><P>" + sText) } function CloseWindow() { Win1.close() } //--> </SCRIPT> Then this button... <FORM> <input type="button" name="WindowButton" value="Open Window" onclick="OpenWindow()"><P> <I>Click here to close the other window:</I><P> <input type="button" name="WindowButton2" value="Close Window" onclick="CloseWindow()"> </FORM>
Previous Example-|-Next Example-|-Return to Chapter Listing