The example in this article describes the method of calling the parent page from iframe in js. Share it with everyone for your reference. The specific implementation method is as follows:
The method for a child page to call the parent page is easy to implement in js. We only need to add a function to the main page, and then use the window.parent.method() on the sub-page to achieve it
For example, when calling the a() function, it would be written as:
<script><br> function dey() {<br> var cards_frame=document.frames("card-iframe"); //card-iframe is the name of iframe <br> cards_frame.checkedCard() //Call the method defined in the iframe to pass the value of the embedded page to the parent page <br> }<br> </script>
I hope this article will be helpful to everyone’s JavaScript programming design.