国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

location網(wǎng)址列對象

Location網(wǎng)址列物件

  • #href:取得網(wǎng)址列中完整的位址??梢詫崿F(xiàn)JS的網(wǎng)頁跳轉(zhuǎn)。 location.href = “http://www.sina.com.cn”;

  • #hostname:主機名稱

  • ##pathname:檔案路徑及檔名

  • search:查詢字串。

  • protocol:協(xié)議,如:http://、ftp://

  • #hash:錨點名稱。如:#top

  • reload([true]):重新整理網(wǎng)頁。 true參數(shù)表示強制刷新

注意:所有的屬性,重新賦值後,網(wǎng)頁會自動刷新。

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>php.cn</title>
        <script type="text/javascript">
            //實例:測試不同瀏覽器
            var str = "<h2>地址欄對象</h2>";
            str += "地址欄地址:"+location.href;
            str += "<br>主機名:"+location.hostname;
            str += "<br>文件路徑及文件名:"+location.pathname;
            str += "<br>協(xié)議:"+location.protocol;
            document.write(str+"<hr>");
        </script>
    </head>
    <body >
    </body>
</html>


#

繼續(xù)學(xué)習(xí)
||
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>php.cn</title> <script type="text/javascript"> //實例:測試不同瀏覽器 var str = "<h2>地址欄對象</h2>"; str += "地址欄地址:"+location.href; str += "<br>主機名:"+location.hostname; str += "<br>文件路徑及文件名:"+location.pathname; str += "<br>協(xié)議:"+location.protocol; document.write(str+"<hr>"); </script> </head> <body > </body> </html>