我想知道什么location.search.substring(1)
事实上确实如此。我在某个网站上看到了这段代码。我尝试使用打印alert
,但这并没有给出任何结果。它应该提醒 location href 吗?
alert(location.search.substring(1))
http://example.com/index.php?foo=bar
location.search
> ?foo=bar
location.search.substring(1)
> foo=bar
这样代码将返回整个查询参数without问号。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)