您當(dāng)前位置:圖趣網(wǎng)(Tuquu) >> 網(wǎng)頁(yè)設(shè)計(jì)教程 >> 移動(dòng)前端 >> 瀏覽設(shè)計(jì)教程

實(shí)現(xiàn)網(wǎng)頁(yè)頁(yè)面跳轉(zhuǎn)的幾種方法(meta標(biāo)簽、js實(shí)現(xiàn)、php實(shí)現(xiàn))

今天總結(jié)了幾種頁(yè)面跳轉(zhuǎn)的方法,分別是用meta標(biāo)簽實(shí)現(xiàn)、用javascript實(shí)現(xiàn)、用php實(shí)現(xiàn),下面就來(lái)一一分享一下吧。

1、meta標(biāo)簽實(shí)現(xiàn)

只需在head里加上下面這一句就行了,在當(dāng)前頁(yè)面停留0.1秒后跳轉(zhuǎn)到目標(biāo)頁(yè)面

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

2、Javascript實(shí)現(xiàn)

方法一:

這個(gè)方法比較常用

window.location.href = "http://irelandcustomcontracting.com/";

方法二:

self.location = "http://irelandcustomcontracting.com/";

方法三:

top.location = "http://irelandcustomcontracting.com/";

方法四:

只對(duì)IE系列瀏覽器有效,實(shí)用性不大

window.navigate("http://irelandcustomcontracting.com/");

3、php實(shí)現(xiàn)

<?php
    header("Location: http://irelandcustomcontracting.com/");
?>

Ok,以上就是今天總結(jié)的幾種頁(yè)面跳轉(zhuǎn)的方法了。

[教程作者:admin]
免責(zé)聲明:本站文章系圖趣網(wǎng)整理發(fā)布,如需轉(zhuǎn)載,請(qǐng)注明出處,素材資料僅供個(gè)人學(xué)習(xí)與參考,請(qǐng)勿用于商業(yè)用途!
本文地址:http://irelandcustomcontracting.com/tutorial/wd2313.html
多行文本溢出顯示省略號(hào)(…)全攻略
解決Chrome瀏覽器下CSS字體大小設(shè)置小于12px無(wú)效問(wèn)題
圖趣網(wǎng)微信
建議反饋
×