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:
child.html subpage:
I hope this article will be helpful to everyone’s web programming based on JavaScript.