html php 重定向 跳转 刷新

来源:互联网 发布:市场策划是做什么 知乎 编辑:程序博客网 时间:2024/05/16 17:26
1秒后跳转
法一:

<!DOCTYPE HTML>
<html>
<head>    
<meta http-equiv="refresh" content="1;url=http://wiki.elesos.com">   
</head>


</html>


2,js实现
<script>   
// 以下方式直接跳转  
window.location.href='http://wiki.elesos.com';  
// 以下方式定时跳转  
setTimeout("javascript:location.href='http://wiki.elesos.com'", 1000);   
</script> 



使用content属性表示刷新或跳转的开始时间与跳转的网址

5秒之后刷新本页面:

<meta http-equiv="refresh" content="5" />

5秒之后转到首页:

<meta http-equiv="refresh" content="5; url=http://www.elesos.com/" />

php跳转与定时跳转
header("Location: $httpfile");
header("refresh:1;url=$httpfile");

0 0