页面自动刷新两种方式

1.在head中加入<meta http-equiv="refresh" content="10">指定10秒刷新一次;


2.使用js

<script  type="text/javascript">

function refresh(){
window.location.reload();
}
setTimeout('refresh()',2000); //指定1秒刷新一次

</script>


为了验证刷新了

我们在body中加入一段代码

<body onload="alert('我被加载了!')"> 

猜你喜欢

转载自blog.csdn.net/jiankking/article/details/60091799