When using js, you will encounter the following requirement: I am sorry to use the Child Window to operate the parent window image, so I searched and sorted it out and shared it with you, for more information about how to operate parent window objects in ModalDialog, see
1. window. parent cannot be used.
Window. parent is used to operate in the frame. It cannot be used to operate the parent Window object in the dialog box.
2. correct practices
You can call modaldialog by passing parameters.
Example:
Requirement
The parent window is a.html and B .html. A.html has a dialog box named test1. Click a button in the dialog box to change the text box value of a.html to "subwindow value ".
Implementation
When the dialog box is opened, set test1as a parameter to the window. In the window, obtain the parameter value, and set the value attribute value of the text object (that is, the text object passed in a.html) to "subwindow value"
Note: Only id and name are allowed.
A.html code:
The Code is as follows:
A.html
B .html code:
The Code is as follows:
B .html