HTML DOM search 屬性
定義和用法
search 屬性是一個(gè)可讀可寫的字符串,可設(shè)置或返回當(dāng)前 URL 的查詢部分(問號 ? 之后的部分)。
語法
location.search=path_from_questionmark
實(shí)例
假設(shè)當(dāng)前的 URL 是: http://www.dbjr.com.cn/tiy/t.asp?f=hdom_loc_search
<html>
<body>
<script type="text/javascript">
document.write(location.search
);
</script>
</body>
</html>
輸出:
?f=hdom_loc_search