Opener that who open my, such as a page with window.open pop up the B page window, then a page is located in the window is B page opener, b page through the opener object can access a page. The parent indicates that a page, such as an an A, uses an IFRAME or frame to invoke page B, then the page A is the parent of page B. In JS, Window.opener is just a reference to the pop-up window's parent window. For example: a.html, window.open a new window b.html by clicking the button. In b.html, you can use Window.opener (omit write as opener) to refer to a.html, including A.html's document and other objects, to manipulate the contents of a.html. If this reference fails, then NULL is returned. Therefore, before invoking the opener object, you should first determine whether the object is null, otherwise the "object is empty or does not exist" JS error. --------------------------------back2opener.html--------------------------------Window.opener Returns a reference to the window that created the current window, such as clicking on a link on a.htm and opening the b.htm, and then we're going to enter a value on b.htm and give it a TextBox with the ID "name" on the a.htm. It can be written as: Window.opener.document.getElementById ("name"). Value = "Data entered";
The difference between opener and parent in JS