我的java天地

关于页面刷新和iframe刷新

1.页面中刷新  window.location.reload();

2.iframe刷新
<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','')">


posted on 2009-06-24 00:31 tobyxiong 阅读(2756) 评论(0)  编辑  收藏 所属分类: show page


只有注册用户登录后才能发表评论。


网站导航:
 
<2009年6月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

导航

统计

常用链接

留言簿(3)

随笔分类(144)

随笔档案(157)

相册

最新随笔

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜