设为首页
 加入收藏
 联系站长
站内搜索:   您的位置:PHP自学网>> 首页 >> Javascript >> js实现刷新iframe的方法

js实现刷新iframe的方法

日期:2008-08-23     来自:互联网    浏览:7821

 <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','')">

  TAGs: js   iframe   刷新  
文章评论:(查看全部评论)
昵   称: 匿名 关闭留言
还可以输入250个字 (请自觉遵守互联网相关政策法规)

验证码: 点击图片刷新验证码
  • phpzixue 2010-12-28 17:29:13   北京市网通
  • 先收藏了
  • phpzixue 2010-05-18 10:14:46   广东省佛山市禅城区电信
  • 火狐用contentWindow应该可以
  • HANK 2010-05-08 21:32:18   河北省保定市网通
  • 火狐啊。。。你试过嘛。。。
  • 橘子酱 2009-02-10 16:17:21   美国 21andy.com
  • 在firefox下面均无效。。
  • 相关文章
    热门文章
    随机文章