Home >Web Front-end >JS Tutorial >Implementation method of function calling within javascript iframe_javascript skills

Implementation method of function calling within javascript iframe_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:49:591082browse
sxmsxm.html

Copy code The code is as follows:

<script> function sonfun() { alert('ok'); } </script>


main.html

Copy code The code is as follows:




There are two ways to execute sonfun() in sxmsxm.html in main.html

1. sxm.sonfun()

2. document.getElementById("sxm").contentWindow.sonfun();
Statement:
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