Frameset with sample code
. To access any page contained within the frameset, you must start with a reference to its parent. After the parent reference, just declare the frame's name (the HTML name attribute's value that is assigned in the frameset page), then any property or object available to it. NOTE: Framesets are also considered an array, so array syntax with either integer indices or associative indices can be used as path references.
The single window containing the parent document and each of its child frames is known as top
. Top's location can be, and usually is, a frameset's parent page. However, if you are dealing with nested framesets -when the source of a frame contained in a frameset is actually another frameset- a reference to the parent of a page within the nested frameset is not the same as a reference to the top. Be careful not to confuse the top reference with the parent reference if your site contains nested framesets.
The Golden Rule
When referencing a different frame, the reference must begin with the window the two have in common - be it parent or top.
Note: Pop up windows: if a frame in a frameset launches a new window, that new window also has access to any frame in the frameset by, "opener.parent.FrameName".
Note: Nested Framesets: a frame within a nested frameset has access to a frame in the main frameset by, "parent.parent.FrameName".
Take a look at the sample frameset page