Every WINDOW object, whether it is a regular HTML page. Frameset page. Whether a child frame or a grandchild frame, both have a TOP attribute. This property returns a reference to the top-level WINDOE object loaded into the browser;
. If the WINDOW object is a regular HTML page, TOP is SELF
. . . . . . . Top-level frames and pages, . . . . . . . .
. . . . . . . For subframes, TOP points to the parent of the frame, that is to say, the following two expressions are equivalent;
SELF.TOP
SELF.PARENT
. If the WINDOW object is a subframe, TOP points to the frame's grandparent. That is to say, the following two expressions are equivalent to
self.top
self.parent.parent
This may remind you of a good way to reduce the number of keystrokes, especially if you think that you can only apply TOP itself (that is, use TOP itself instead of SELF.TOP or WINDOW.TOP). Although this is feasible, But special attention should be paid: you must ensure that TOP really points to your top-level framework