Location search 屬性
定義和用法
search 屬性是一個可讀可寫的字符串,可設置或返回當前URL 的查詢部分(問號? 之後的部分)。
語法
location.search
瀏覽器支持
所有主要瀏覽器都支持search 屬性
實例
實例
返回URL的查詢部分。 假設當前的URL就是http://www.w3big.com/submit.htm?email=someone@ example.com:
<script>
document.write(location.search);
</script>
document.write(location.search);
</script>
以上實例輸出結果:
Location對象