Home > Web Front-end > JS Tutorial > body text

Detailed explanation of the steps for calling iframe parent window and child window with jquery+js

php中世界最好的语言
Release: 2018-04-26 15:21:41
Original
3087 people have browsed it

This time I will bring you jquery Detailed explanation of the steps for js to call iframe parent window and child window. What are the precautions for jquery js to call iframe parent window and child window? The following are Let’s take a look at practical cases.

1. jquery gets the elements of the parent page in the iframe sub-page. The code is as follows:

$("#objid", parent.
document
)
Copy after login

2. jquery gets the elements of the iframe sub-page in the parent page.

$("#objid",document.frames('iframename').document)
Copy after login

3.js in The code for the iframe sub-page to obtain the element of the parent page is as follows:

indow.parent.document.getElementByIdx_x("元素id");
Copy after login

4.js The code for the iframe sub-page element to be obtained from the parent page is as follows:

window.frames["iframe_ID"].document.getElementByIdx_x("元素id");
Copy after login

5. Call the parent class in the sub-class iframe Function :

window.parent.func();
Copy after login

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to the php Chinese website and other related articles!

Recommended reading:

AJAX uses proxy, JSONP, and XHR2 to achieve cross-domain

##What are the implementations of AJAX secondary linkage method

The above is the detailed content of Detailed explanation of the steps for calling iframe parent window and child window with jquery+js. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!