實現網頁頁面轉址的幾種方法(meta標籤、js實現、php實現)

 1、meta標籤實現 只需在head裡加上下面這一句就行了,在當前頁面停留0.1秒後跳轉到目標頁面

<meta http-equiv="refresh" content="0.1; url=http://baidu.cn/">

2、Javascript實現
方法一:
這個方法比較常用

window.location.href = "http://baidu.cn/";

方法二:

self.location = "http://baidu.cn/";

方法三:

top.location = "http://baidu.cn/";

    方法四:
    只對IE系列瀏覽器有效,實用性不大

window.navigate("http://baidu.cn/");

3、php實現

<?php
    header("Location: http://baidu.cn/");
?>

留言

這個網誌中的熱門文章

c語言-關於#define用法

CMD常用網管指令

PHP 與 JavaScript 之間傳值利用 json