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

Value transfer between Iframes in JS and application between subpages and parent pages_javascript skills

WBOY
Release: 2016-05-16 17:40:46
Original
1200 people have browsed it

In js, we often use iframe as the system framework. In child pages, value transfer between parent pages is a problem. The following is js to obtain the object js of the parent form and child form:

1. Get the elements of the parent page in the iframe subpage :
a> window.parent.document is to get the object in the document of the parent page;
b> If you want to get Methods in parent page js: window.parent.xxxx(); a>


Copy code

The code is as follows: var child = document.getElementByIdx_x("mainFrame" ).contentWindow;//The id of mainFrame is the id of the parent page iframe child.document;//Get the document object in the child page;
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!