Opener is who opens my window. For example, if window. open is used to pop up the B page window on page A, the window where page A is located is the B page
Opener: You can access page A through the opener object on page B.
Parent indicates the parent window. For example, if A page A uses iframe or frame to call page B, the window where page A is located is
Parent.
In JS, window. opener only references the parent window of the pop-up window. For example:
A.html, click "click" and click "other" to open a new window B .html. In B .html, you can use
When using opener(specifically, using opener.pdf to reference a.html, including a.html documentobjects, and operating a.html content.
If this reference fails, null is returned. Therefore, before calling the opener object, you must first determine whether the object is null. Otherwise
The JS error "the object is null or does not exist" is displayed.
<Html>
<Body>
<Form. name = form1>
<Input type = text name = inpu>
<Input type = button>
</Form>
</Body>
</Html>
--------------------------------
Back2opener.html
--------------------------------
<Html>
<Body>
<Form. name = form1>
<Input type = text name = inpu>
<A class = under href = #> Add </a>
</Form>
</Body>
</Html>
Window. opener returns the reference of the window that creates the current window.
B .htm, then we can input a value on B .htmand assign it to a textbox with the id "name" on a.htm.
Written:
Optional values opener.doc ument. getElementById ("name"). value = "input data ";
From Zhang Yi ☆. Net★Java software alliance