1.js的定时器
//第一种方法在js页面设置
function test(){
consolo.log("我刷新了");
}
setInterval(test, 1000);//间隔一秒不断循环刷新;
setTimeout(test,1000);//只刷新一次;
2.通过meta来设置刷新:
<!--第二种方法-->
<!--定时自动刷新,content表示刷新间隔,单位为秒s,下面代码表示页面每隔三秒刷新一次-->
<meta http-equiv="refresh" content="3">
<!--第三种方法-->
<!--这种方法实现页面刷新有点投机取巧,这个标签作用是定时跳转,
content第一个参数表示间隔时间,单位为秒,
第二个参数表示目标网址,
但是如果把第二个参数设为#,就会实现页面刷新。-->
<meta http-equiv="refresh" content="3;url=#">
3.其他刷新方法
1,history.go(0)
2,location.reload()
3,location=location
4,location.assign(location)
5,document.execCommand('Refresh')
6,window.navigate(location)
7,location.replace(location)
8,document.URL=location.href