Home
Web Front-end
JS Tutorial
Call the JS method of the child page in the parent page_javascript skills



Call the JS method of the child page in the parent page_javascript skills
js
After working on it all day today, I finally found a solution online
Note: The problem is the method of calling the child page on the parent page. . . . .
Parent page: parent.html
Copy code The code is as follows:
<script><br> function parentFunction() {<br> alert('function in parent');<br> }<br> function callChild() {<p> child.window.childFunction();<br> /*<br> child is the name attribute value of the iframe, <br> cannot be the id, because the id cannot be obtained from the iframe under FireFox Object<br> */<br> }<br></script>