页面刷新代码

发布时间:2016-04-21 17:10 | 人气数:1028

有三种方法:

1,在html中设置:

<title>xxxxx</title>之後加入下面这一行即可! 

定时刷新:<META HTTP-EQUIV="Refresh" content="10;url=网页名"> 

10代表刷新间隔,单位为秒

2.PHP

<meta http-equiv=”Refresh” content=”3;URL=<?php echo ‘index.php?’.rand(0,999);?>” />

这里是定为3秒钟刷新一次~

3.使用javascript:

<script language="javascript">

setTimeout("self.location.reload();",1000);

<script>

一秒一次 

页面自动跳转:

1,在html中设置:

<title>xxxxx</title>之後加入下面这一行即可! 

定时跳转并刷新:<meta http-equiv="refresh" content="20;url=http://自己的URL">,

其中20指隔20秒后跳转到http://自己的URL 页面。

< META HTTP-EQUIV="REFRESH" CONTENT="x; URL=*.*">

记得要设置 url~

关键词:自动跳转, 页面刷新, 自动刷新