Reference method top:
This variable always refers to the browser window at the highest level of the split window. If you plan to execute commands from the highest level of the split window, you can use the top variable.
parent:
This variable refers to the parent window that contains the current split window. If there is a split window within a window, and one of the split windows contains a split window, the split window on level 2 can use the parent variable to reference the parent split window that contains it.
Attachment: The hierarchical relationship between Window object, Parent object, Frame object, Document object and Form object
Windwo object→Parent object→Frame object→Document object→Form object, as follows:
parent. frame1.document.forms[0].elements[0].value;
In JS: window.location(window.location.href) and window.top.location(window.top.location.href) are the same It means that any frame can be called through top, because top refers to the outermost frameset, and any sub-element frame in it can be called. Such as: top.outterFrame1.location and top.innerFrame2.location, etc.
parent refers to the parent window (frameset) of the current window (frame) that can call any child element frame in it. Such as: parent.innerFrame1.location and parent.innerFrame2.location, etc.
top frame parent example
< ;/html>