今天總結了幾種頁面跳轉的方法,分別是用meta標簽實現、用javascript實現、用php實現,下面就來一一分享一下吧。
1、meta標簽實現
只需在head裡加上下面這一句就行了,在當前頁面停留0.1秒後跳轉到目標頁面
1<meta http-equiv="refresh" content="0.1; url=http://beyondweb.cn/">
2、Javascript實現
方法一:
這個方法比較常用
1window.location.href = "http://beyondweb.cn/";
方法二:
1self.location = "http://beyondweb.cn/";
方法三:
1top.location = "http://beyondweb.cn/";
方法四:
只對IE系列浏覽器有效,實用性不大
1window.navigate("http://beyondweb.cn/");
3、php實現
1 2 3<?php
header("Location: http://beyondweb.cn/");
?>
Ok,以上就是今天總結的幾種頁面跳轉的方法了。