拆解url的各部分

console.log(location.href)
console.log(location.protocol) // 'http:' 'https:'
console.log(location.pathname) // '/learn/199'
console.log(location.search)
console.log(location.hash)
posted @ 2019-04-06 16:05  木石天涯  阅读(541)  评论(0编辑  收藏  举报