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

Example 15.2:
Referring to Parents, Grandparents, & Siblings in JavaScript 1.1

This time we can refer back to the parent and grandparent windows from the grandchild, and even the sibling of a parent, as long as we are using a JavaScript 1.1 browser (Navigator 3). First, click on these buttons to open two child windows. In the first of those child windows, click on the button to open yet another window (the grandchild). Then use the buttons in thd grandchild to modify the status bars in all the other windows.


This is the script we used in the HEAD: <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- function WinOpen() { Win1=open("child2.htm","Window1","resize,status,height=400,width=575"); } function WinOpen2() { Win2=open("child3.htm","Window2","resize,status,height=400,width=575"); } //--> </SCRIPT> Then these buttons: <FORM> <input type="button" name="WindowButton" value="Open a Child Window" onclick="WinOpen()"><P> <input type="button" name="WindowButton" value="Open a Child Window" onclick="WinOpen2()"><P> </FORM>
Previous Example-|-Next Example-|-Return to Chapter Listing