html 页面跳转方式

网页的跳转在很多时候都非常的有用,下面的是两个简单的例子。仅供参考。

一、用<meta>里直接写刷新语句:5秒后跳转到百度

    <html>
    <head>
    <meta http-equiv="refresh" content="5;url=http://www.baidu.com">
    <title>跳转测试</title>
    </head>
    <body>

    测试:html网页自动跳转代码

    </body>
    </html>  

二、用javascript的window.location.href方法实现跳转

<script language="javascript" type="text/javascript"> 
// 方式一 直接跳转
window.location.href='hello.html';
// 方式二 定时跳转
setTimeout("javascript:location.href='hello.html'", 5000); 
以上两种任选其一
</script>
原文地址:https://www.cnblogs.com/ZJ199012/p/3465586.html