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

Example 15.6:
Changing Frame Contents with JavaScript

Click on the buttons to modify the frame contents:




This is the script we used: <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- function new1() { parent.frame2.document.write("<P>Here's some more text for you...and some more. Yes, and more, and yet more<BR>") } function new2() { parent.frame3.document.write("Making predictions is very difficult, especially about the future.<BR>") } function new3() { parent.frame4.document.write("Um...what else can I say? Oh, I know, I'll omit the line break and see what happens.") } //--> </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