JS自动刷新页面一次

<script type="text/javascript">
	//刷新页面
	if(location.href.indexOf("refresh=1") === -1) {
	       setTimeout(function() {
		     location = location.href + "?refresh=1"
	       },1)
	}
</script>

或者

<script type="text/javascript">
	//刷新页面
	function refreshOnce(){
	       if (location.href.indexOf("?xyz=") < 0) {
	             location.href = location.href + "?xyz=" + Math.random();
	        }
	 }
</script>	
		
<body onload="refreshOnce()">


posted on 2013-12-07 13:32  itmyhome  阅读(610)  评论(0编辑  收藏  举报

导航