首页
视频
资源
登录
雪霏
昔我往矣,杨柳依依。今我来思,雨雪霏霏
博主信息
排名
6
文章
6
粉丝
16
评论
8
文章类别
前端
8篇
架构
1篇
随笔
6篇
EF
1篇
NET CORE
2篇
移动开发
2篇
最新文章
最新评价
{{item.articleTitle}}
{{item.blogName}}
:
{{item.content}}
关于我们
ICP备案 :
渝ICP备18016597号-1
网站信息:
2018-2025
TNBLOG.NET
技术交流:
群号656732739
联系我们:
contact@tnblog.net
公网安备:
50010702506256
欢迎加群
欢迎加群交流技术
原
调用iframe里边的方法
6538
人阅读
2020/7/21 19:02
总访问:
123563
评论:
0
收藏:
0
手机
分类:
随笔
加载一个iframe ``` <iframe id="son" src="a.html"></iframe> ``` iframe里边的内容 ``` <body> 这是子页面 <script> function test() { console.log("子页面的方法"); } </script> </body> ``` 这样调用即可 ``` document.getElementById('son').contentWindow.test(); ``` tn>注意:需要iframe加载完毕后才能调用哦,不然会找不到的
👈{{preArticle.title}}
👉{{nextArticle.title}}
评价
{{titleitem}}
{{titleitem}}
{{item.content}}
{{titleitem}}
{{titleitem}}
{{item.content}}