绿色资源网

电脑版
提示:原网页已由神马搜索转码, 内容由www.downcc.com提供.
您的位置:首页网页设计网页特效→ JS实现刷新iframe的方法

JS实现刷新iframe的方法

我要评论2012/06/25 11:17:42 来源:绿色资源网编辑:downcc.com 评论:0点击:287次

<iframe src="1.htm" name="ifrmname" id="ifrmid"></iframe>

  方案一:用iframe的name属性定位

<input type="button" name="Button" value="Button"
onclick="document.frames('ifrmname').location.reload()">

  或

<input type="button" name="Button" value="Button"
onclick="document.all.ifrmname.document.location.reload()">

  方案二:用iframe的id属性定位

<input type="button" name="Button" value="Button"
onclick="ifrmid.window.location.reload()">

  终极方案:当iframe的src为其它网站地址(跨域操作时)

<input type="button" name="Button" value="Button"
onclick="window.open(document.all.ifrmname.src,'ifrmname','')">

关键词:JS,iframe

相关阅读

阅读本文后您有什么感想? 已有 人给出评价!

  • 3

  • 5

  • 6

  • 74

  • 4

  • 2

用户评论

热门评论

最新评论

发表评论查看所有评论(0)

昵称:
请不要评论无意义或脏话,我们所有评论会有人工审核.
字数: 0/500(您的评论需要经过审核才能显示)

相关软件

热点图文

    更多+

    精品软件