您好,欢迎来到点滴吧! 手机版
点滴吧www.diandiba.com
记录点点滴滴,尽在点滴吧
  • 文章
  • 文章
  • 特效
  • 素材
  • 景点
您现在的位置:首页 > JavaScript教程 > 文章正文
JS实现刷新iframe的方法
更新时间:2015/6/23 9:28:58   点击:3349次

<iframe src="1.htm" ></iframe>


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

<input type="button" value="Button"

onclick="document.frames('ifrmname').location.reload()">

<input type="button" value="Button"

onclick="document.all.ifrmname.document.location.reload()">


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

<input type="button" value="Button"

onclick="ifrmid.window.location.reload()">


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

<input type="button" value="Button"

onclick="window.open(document.all.ifrmname.src,'ifrmname','')">

相关文章
导航分类
热门文章
关于我们| 联系我们| 免责声明| 网站地图|
CopyRight 2012-2015 www.diandiba.com - 点滴吧 All Rights Reserved
滇ICP备09005765号-2