Home  >  Article  >  Web Front-end  >  javascript iframe内的函数调用实现方法_javascript技巧

javascript iframe内的函数调用实现方法_javascript技巧

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

复制代码 代码如下:

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


main.html

复制代码 代码如下:




在main.html中执行 sxmsxm.html中的sonfun() 有两种方式

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