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

Example 15.7:
Using document.close

This time we used document.open and document.close. Click on the buttons to modify the frame contents:




This is the script we used: <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- function new1() { parent.frame2.document.open() parent.frame2.document.write("<P>Here's some more text for you...and some more. Yes, and more, and yet more<BR>") parent.frame2.document.close() } function new2() { parent.frame3.document.open() parent.frame3.document.write("Making predictions is very difficult, especially about the future.<BR>") parent.frame3.document.close() } function new3() { parent.frame4.document.open() parent.frame4.document.write("Um...what else can I say? Oh, I know, I'll omit the line break and see what happens.") parent.frame4.document.close() } //--> </SCRIPT> Then these buttons: <FORM> <INPUT TYPE="BUTTON" VALUE="Change frame2" onclick="new1()"><BR> <INPUT TYPE="BUTTON" VALUE="Change frame3" onclick="new2()"><BR> <INPUT TYPE="BUTTON" VALUE="Change frame4" onclick="new3()"><BR> </FORM>
Previous Example-|-Next Example-|-Return to Chapter Listing