Each frame in a frameset is a property of the window object. The browser is showing multiple frames (and documents) onscreen, but they are each displayed in the browser's window object. To enable inter-frame communication, the window object includes a number of properties that identify other windows and frames. These properties include:
The frames property. The frames property is an array containing the component frames of a given frameset container. The first frame in the HTML document can be referenced by using the following syntax:
window.frames[0] . . .
The parent property. The parent property is used by a frame (child window) to reference the frameset container document. For example, the first frame in a frameset can reference the topmost document using the syntax:
window.parent . . .
The top property. The top property is an alternative method for a child window to reference the topmost frameset container. If there is only one frameset in the document, the top property will simply reference the parent container. However, in situations where you have nested framesets (frames within frames), the top property will always refer to the first (or top) division of the page. The syntax for the top property is:
window.top . . .
The self property. At times it is necessary to clarify which window is being referenced. The self property ensures that a statement will be executed within the context of the current window. The following syntax can be used with the self property:
window.self . . .
However, because the window is the topmost object, you can leave off the window identifier. For example, a call to the Foo() method in a parent document can be accomplished using the following syntax:
parent.Foo();