首页 > window.location.search

window.location.search

大家好,我有个问题:

这里的search是什么,一般有什么作用?


http://www.123.com/headline?page=2&status=&username=&keyword=

window.location.search => ?page=2&status=&username=&keyword=

类似php的$_SERVER["QUERY_STRING"]


获取请求当前页面的参数值。


location.search是从当前URL的?号开始的字符串
比如www.ecoolper.com?nanme=kitty&code=001

var s =window.location.search;
//?nanme=kitty&code=001
【热门文章】
【热门文章】