当前位置: 代码迷 >> Web前端 >> iframe 的刷新形式,这样方式更方便
  详细解决方案

iframe 的刷新形式,这样方式更方便

热度:67   发布时间:2012-11-10 10:48:51.0
iframe 的刷新方式,这样方式更方便。
iframe的刷新方式

1. 刷新方式可以使用 javascript 的 document.fr.location.reload()

2. 还有就是修改 document.fr.location.href 也可以实现刷新的功能

例如:
<iframe name="fr" width="96%" src="alert_search.do?method=findSys"></iframe>

<script type="text/javascript">
	function show_syslog(id){
		document.fr.location.href="/alert_search.do?method=findSys&id="+id;				
	}
</script>
<input type="button" onclick="javascript:show_syslog(1)">


注意:千万不要两种方式同时使用,如果同时使用,将会提交两次。
document.fr.location.href = "your.html"; 
document.fr.location.reload();
1 楼 shenliu 2010-02-14  
我是用 document.fr.src="/alert_search.do?method=findSys&id="+id的,这样不好吗?
2 楼 寄生虫 2010-02-14  
如果iframe中存在form表单,并且提交过一次,这种刷新都会提示重复提交。
大年初一啦,给大家拜年。
3 楼 rainsilence 2010-02-14  
国外出差的路过。。。。
4 楼 习惯在马桶上思考 2010-02-15  
做技术的人。。。。
5 楼 smzd 2010-02-17  
可以回复了吗?不关小黑屋了?
6 楼 kaki 2010-02-18  
谢谢,我正需要。
7 楼 wangliang_gz 2010-02-20  
让iframe进来的页面自己刷新不就行了吗?
用<meta http-equiv=refresh content="10">
8 楼 wtotal 2010-02-20  
提交过一次的form,怎么不提交刷新?
  相关解决方案