天天看點

js實作HTML自動重新整理頁面和跳轉(重定向)

瀹??拌????TML?鋒?伴〉?㈠??璺寵漿椤墊?規???寰?澶?锛?涓昏???涓轟袱绫夥?涓?绫諱負浣跨??tml head??绛撅????绫諱負浣跨??s寮哄?跺?鋒?版??璺寵漿??

1. 浣跨??s ?鋒?闆???椤甸???3绉??ц?涓?娆°??

<script language="JavaScript">  
function Refresh()  
{  
window.location.reload();  
}  
setTimeout('Refresh()',); //3绉??鋒?頒?娆? 
</script> 
           

2. 浣跨??s ???ㄨ煩杞?椤甸???3绉????ц?

<html>  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  
<script language="javascript">  
function goUrl()  
{  
  var url="http://blog.csdn.net/haoaiqian";  
  location.href=url;  
}  
</script>  
</head>  
<body onload="setTimeout('goUrl()', 3000);">  
</body>  
</html> 
           

繼續閱讀