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, a page can be accessed via the opener object on page B.
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.
<a class= "under" href=# > Add </a> </form> </body>
Write as: window.opener.document.getElementByIdx_x_x ("name"). Value = "Data entered"; ============================================ Common misconception: Parent page window.open (' open.jsp? City= ' +strcity, ', ' width=252, height=100, Scrollbars=no '); Sub-page open.jsp Window.parent.maplet.clean (); Error Window.parent.maplet is empty or not an Object! What's the reason? No other problem! Cause of Error: Window.parent represents the parent frame of the current frame, if the child window is not in the frame, then it is empty, not the relationship between the child window and the parent window, and the relationship between the frames. If the child window is not in the frame, that is, the b.html page that is opened by a link to a.html, the b.html refers to the a.html form element, which can be written as follows: Window.opener.document.formname.maplet Where FormName is the name of the form in your parent window
Reproduced:
Yuntao (lost himself)Http://blog.sina.com.cn/shangguanyuntao
The difference between opener and parent in JS