location;
JSON.stringify(location);
('{"ancestorOrigins":{},"href":"https://www.markjour.com/about.html?key=value1&key=value2","origin":"https://www.markjour.com","protocol":"https:","host":"www.markjour.com","hostname":"www.markjour.com","port":"","pathname":"/about.html","search":"?key=value1&key=value2","hash":""}');
location.href; // full url
location.search; // querystring ?key=value&key=value
qs = new URLSearchParams(location.search);
qs.get('key'); // value1
qs.getAll('key'); // [value1, value2]
TOC
Web URL 参数
发布于码厩技术博客的所有文章,除注明转载外,均为作者原创,欢迎转载,但必须注明出处。
尊重他人劳动,共创开源社区!转载请注明以下信息:
转载来源: 码厩技术博客 [https://www.markjour.com]
原文标题:Web URL 参数
原文地址:/article/20150130-js-url-params.html
尊重他人劳动,共创开源社区!转载请注明以下信息:
转载来源: 码厩技术博客 [https://www.markjour.com]
原文标题:Web URL 参数
原文地址:/article/20150130-js-url-params.html
如果你有魔法,你可以看到一个评论框~