JS automatically refresh the page again

<script type="text/javascript">
	//Refresh the page
	if(location.href.indexOf("refresh=1") === -1) {
	       setTimeout(function() {
		     location = location.href + "?refresh=1"
	       },1)
	}
</script>

Or

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


Posted by Christine at December 09, 2013 - 3:45 AM