Home > Web Front-end > JS Tutorial > js method to implement iframe cross-page function calling_javascript skills

js method to implement iframe cross-page function calling_javascript skills

WBOY
Release: 2016-05-16 16:27:32
Original
1478 people have browsed it

The example in this article describes how js implements iframe cross-page function calling. Share it with everyone for your reference. The specific implementation method is as follows:

In the project, you will inevitably encounter such a problem that the page introduces IFrame and needs the parent page to call the child page function or the child page needs to call the parent page function. For example: There are now two pages parent.html and child.html. Among them, parent.html contains IFrame and IFrame points to child.html. Now you need to call a js method of child.html/parent.html in parent.html/child.html. 

The specific code implementation is as follows:

parent.html Parent page:

Copy code The code is as follows:









child.html subpage:

Copy code The code is as follows:








I hope this article will be helpful to everyone’s web programming based on JavaScript.

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