URlSearchParams构造函数获取URL参数的方法
URL的各个部分组成
url的hash部分
const myURL = new URL('https://ddong345:8080/article/foo#index);
//获取
console.log(myURL.hash)//===>#index
//设置
myURL.hash='bar'
console.log(myURL.href);
//=>https://ddong345:8080/article/foo#bar
-url的host部分(主机)
const myURL =
原创
2021-06-15 20:16:03 ·
1368 阅读 ·
1 评论