Home >Web Front-end >JS Tutorial >Detailed explanation of the steps for calling iframe parent window and child window with jquery+js
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 )
2. jquery gets the elements of the iframe sub-page in the parent page.
$("#objid",document.frames('iframename').document)
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");
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");
5. Call the parent class in the sub-class iframe Function :
window.parent.func();
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!