使用[[window.location.pathname作为页面https://google.com/home.html的结果将是“ / home.html”] >>URL中不存在文件名时,例如https://google.com/结果将为 “ /”
是否可以获取当前文件名
使用https://google.com/home.html页面的window.location.pathname使用url中不存在文件名时的结果为“ /home.html”。 https://google.com/结果在来自...的源中将为“ /”]]
浏览器无法了解HTTP服务器将路径转换为资源的过程。