Home >Web Front-end >JS Tutorial >jquery, js call iframe parent window and child window elements method arrangement_jquery

jquery, js call iframe parent window and child window elements method arrangement_jquery

WBOY
WBOYOriginal
2016-05-16 16:40:311267browse

1. jquery gets the parent page element code from the iframe sub-page as follows:

$("#objid", parent.document)

2. jquery gets the elements of the iframe subpage on the parent page

The code is as follows:

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

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

indow.parent.document.getElementByIdx_x("Element id");

4.js Get the iframe subpage element code from the parent page as follows:

window.frames["iframe_ID"].document.getElementByIdx_x("element id");

5. Call the parent class function in the subclass iframe:

window.parent.func();

Statement:
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