之后的所有内容
如果当前url为:"https://stackoverflow.com/questions/ask"
用什么方法来表达"questions/ask" ?
你可以使用
window.location.pathname.substring(1)
您将使用window.location.pathname
console.log(window.location.pathname.substring(1));
这将输出第一个/