Introduction to window.opener usage and usage examples_javascript skills
WBOY
Release: 2016-05-16 17:25:11
Original
1456 people have browsed it
window.opener is a reference to the parent form that opens the child form through window.open.
For example, in the parent form parentForm, through window.open("subForm.html"), then window.opener in subform.html represents parentForm. Since you can get a reference to the parent form in the subform, you can set the field values of the parent form or call js methods in the subform. Example: When adding personnel information, the organization information is entered through the subform. The parent form is used to add personnel information.
After the subform completes the input, the organization information (id, name) is automatically filled in the orgId and orgName fields of the parent form
The input of the organization information (id, name) has been completed, but the id is in the hidden field and cannot be seen. Summary Speaking of references to the parent form, in addition to window.opener, it is window.parent. window.opener is used to open a subform through window.open, and window.parent is used to open a subform through iframe.
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn