This article is mainly on the role of JS top of the in-depth introduction, the need for friends can come to the reference, I hope to help you
Every window object, whether he is a regular HTML page. Frame Set page. Child frame or grandson frame, all have a top property. This property returns a reference to the topmost Windoe object loaded into the browser;
。 If the Window object is a regular HTML page, top is self
。。。。。。。 Top-level frames and pages, ...
。。。。。。。 The child frame, top point to the frame father, that is, the following two expressions are equivalent;
SELF. Top
SELF. PARENT
。 If the Window object is a child frame, top points to the frame of the grandfather. That means the following two expressions are equivalent
Self.top
Self.parent.parent
This may remind you of a good way to reduce keystrokes, especially if you think you can only apply top itself (that is, using top itself instead of self.top or window.top), which is doable, but pay special attention to: you have to make sure that tops really point to your top-level frame