設置或獲取對象指定的“文件名”或路徑。
<script>
alert(window.location.pathname)
</script>
設置或獲取整個 URL 為字符串。
<script>
alert(window.location.href);
</script>
設置或獲取與 URL 關聯(lián)的端口號碼。
<script>
alert(window.location.port)
</script>
設置或獲取 URL 的協(xié)議部分。
<script>
alert(window.location.protocol)
</script>
設置或獲取 href 屬性中在井號“#”后面的分段。
<script>
alert(window.location.hash)
</script>
設置或獲取 location 或 URL 的 hostname 和 port 號碼。
<script>
alert(window.location.host)
</script>
設置或獲取 href 屬性中跟在問號后面的部分。
<script>
alert(window.location.search)
</script>
網(wǎng)頁刷新推薦-JS
<input type=button value=刷新>
<input type=button value=刷新>
<input type=button value=刷新>
<input type=button value=刷新>
<input type=button value=刷新>
<input type=button value=刷新>
<input type=button value=刷新>
<input type=button value=刷新>
新聞熱點
疑難解答
圖片精選