361Chapter 16Window and Frame ObjectsFigure 16-2:The parent and (Disney web site)

361Chapter 16Window and Frame ObjectsFigure 16-2:The parent and frames are partof the object model. Each tag inside the tag set creates another windowobject into which adocument is loaded. Each of those frames, then, has a documentobject associated with it. From the point of view of a given document, it has a single window container, just as in themodel shown in Figure 16-1. And although the parentobject is not visible to the user, itremains in the object model in memory. The presence of the parent often makes it a conve- nient repository for variable data that need to be shared by multiple child frames or mustpersist between loading of different documents inside a child frame. In even more complex arrangements, as shown in Figure 16-3, a child frame itself may load aframesetting document. In this situation, the difference between the parentand topobjectsstarts to come into focus. The top window is the only one in common with all frames in Figure16-3. As you see in a moment, when frames need to communicate with other frames (andtheir documents), you must fashion references to the distant object via the windowobjectthat they all have in common. Figure 16-3:Three generations ofwindow objects. TopParentChildFrameDocumentChildFrameChildFrameDocumentChild FrameParent DocumentTopParentTopParentDocumentDocumentTopParent

Leave a Reply