Previous Example-|-Next Chapter's Examples-|-Return to Chapter Listing

Example 15.8:
Calling Functions from Another Frame

Click on the buttons in the far right frame (start at the top button) to modify the frame contents:
This is the script we used: <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- function new1() { parent.frame2.document.open() parent.frame2.document.write("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> </HEAD> Then these buttons in the far right frame: <FORM> <INPUT TYPE="BUTTON" VALUE="Change frame2" onclick="parent.frame1.new1()"><BR> <INPUT TYPE="BUTTON" VALUE="Change frame3" onclick="parent.frame1.new2()"><BR> <INPUT TYPE="BUTTON" VALUE="Change frame4" onclick="parent.frame1.new3()"><BR> </FORM>
Previous Example-|-Next Chapter's Examples-|-Return to Chapter Listing