location.search

location.search

返回URL的查询部分。假设当前的URL就是http://www.runoob.com/submit.htm?email=someone@ example.com:

 

<script>

document.write(location.search);

</script>

以上实例输出结果:

?email=someone@example.com
 
posted @ 2020-09-22 17:47  妖精泛泛  阅读(174)  评论(0)    收藏  举报