两种方法实现定时刷新页面

在做实现定时刷新页面的功能时,发现了两种实现方法:
(1)一种方法是用Html的方法实现
<meta http-equiv="refresh" content="3">

意思是每隔3秒钟后刷新
<meta http-equiv="refresh" content="3;URL=http://www.jd265.com/">

意思是隔3秒钟后刷新,并且跳转到指定url的页面
(2)另一种是用js代码实现
<script language="JavaScript"> 
function myrefresh() { 
window.location.reload(); 
} 
setTimeout('myrefresh()',3000);

猜你喜欢

转载自dachuan212.iteye.com/blog/2009918