久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      js怎么跳轉(zhuǎn)到指定頁(yè)面?

      跳轉(zhuǎn)方法:1、使用“l(fā)ocation.href="指定頁(yè)面的URL";”語(yǔ)句跳轉(zhuǎn);2、使用“l(fā)ocation.replace("指定頁(yè)面的URL");”語(yǔ)句跳轉(zhuǎn);3、使用“l(fā)ocation.assign("指定頁(yè)面的URL");”語(yǔ)句跳轉(zhuǎn)。

      js怎么跳轉(zhuǎn)到指定頁(yè)面?

      推薦教程:《JavaScript視頻教程》

      方法1:使用window.location.href方式進(jìn)行跳轉(zhuǎn)

      該種方法可以直接跳轉(zhuǎn)指定頁(yè)面。

      <script type="text/javascript"> window.location.href = "https://www.php.cn"; </script>

      window可省略,可簡(jiǎn)寫(xiě)為:

      location.href="URL"

      方法2:使用window.loction.replace方式進(jìn)行跳轉(zhuǎn)

      語(yǔ)法:

      window.location.replace("url") //可簡(jiǎn)寫(xiě)為 location.replace("url")

      將地址替換成新 url,該方法通過(guò)指定 URL 替換當(dāng)前緩存在歷史里(客戶(hù)端)的項(xiàng)目,因此當(dāng)使用 replace 方法之后,你不能通過(guò)"前進(jìn)"和"后退"來(lái)訪問(wèn)已經(jīng)被替換的URL,這個(gè)特點(diǎn)對(duì)于做一些過(guò)渡頁(yè)面非常有用!

      示例

      <script type="text/javascript"> window.location.replace("https://www.php.cn") </script>

      方法3:使用location.assign方式進(jìn)行跳轉(zhuǎn)

      assign()方法加載一個(gè)新的文檔。

      語(yǔ)法:

      location.assign(URL)

      示例:

      <script type="text/javascript"> window.location.assign("https://www.php.cn") </script>

      方法4:使用window.navigate方式進(jìn)行跳轉(zhuǎn)

      語(yǔ)法:

      window.navigate("url");

      navigate對(duì)象包含有關(guān)瀏覽器的信息,也可以作為頁(yè)面跳轉(zhuǎn),后面直接加要跳轉(zhuǎn)的地方。

      示例:

      <script language="javascript"> window.navigate("b.html"); </script>

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)