Differences Between opener and parent in js: openerparent

Source: Internet
Author: User

Differences Between opener and parent in js: openerparent
Opener is who opens my project. For example, A page uses window. when the open dialog box appears, the window where page A is located is the opener of page B. 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 the parent of page B. In JS, window. opener only references the parent window of the pop-up window. For example, in a.html, open a new window B .html by clicking the "click" and click "other" to generate a new window. Contents. If this reference fails, null is returned. Therefore, before calling an opener object, you must first determine whether the object is null. Otherwise, a JS error "the object is empty or does not exist" will occur. --------------------------------Back2opener.html -------------------------------- window. in a textbox with the id "name" on the opener connector, you can write it as follows: zookeeper opener.doc ument. getElementById ("name "). value = "input data ";
Q: What are their differences in js such as windowlocation, windowopener, and parent? There are other issues. Please help me with them. Thank you very much.

Window. location setting the current page address is limited to the current page. Generally, when the webpage uses the frame structure, it is used to jump to the page window. opener enables parameters in a new page to set the size of the new page and other related information opener. parent sets the webpage display address and window. location is similar, but it sets the address window of the entire page. location only sets the local page address of the currently displayed page. The difference is generally only visible when the framework is used on the page.

Opener problems in js

Generally, iframe is used to call the current window. Similar to parent

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.