Introduction to the meanings of top parent and opener of JS window objects

  • 2020-03-30 00:41:08
  • OfStack

1. The top
This change always refers to splitting the browser window at the highest level of the window. If you plan to start at the highest level of the split window, you can use the top variable.
2. The opener
Opener is used to reference an object on a page that executes the window.open method in a window.open page. For example: A page through window.open()
The method pops up the B page, where you can reference the A page with A opener, so you can use this object to manipulate the A page.
3. The parent
Parent is used to access the object of the parent page in the child page generated in the iframe. For example: A page has an iframe or A frame, then the iframe
A page in A parent object or A frame can reference an object in A page through the parent object. This allows you to get or return A value to page A.
4. Also, self refers to the current window

The difference between parent and opener:

Parent is the parent window, and in FRAMESET, the parent of FRAME is the FRAMESET window.
Opener is the original WINDOW for a new WINDOW created with window.open, etc.
Parent is the parent window object relative to the framework
Opener is the parent of a window that opens with window.open, as long as the window is open

Document. ParentWindow. Menthod () � � with father method below

Attachment: the hierarchical relationship between the Window object, Parent object, Frame object, Document object, and Form object
Window object - Parent object - Frame object - Document object - Form object,
As follows: the parent. Frame1. Document. Forms [0]. Elements [0]. Value;


Related articles: