window.location 对象可用于获取当前页面地址(URL)并把浏览器重定向到新页面
Window Location(window可省略)
window.location.href 返回当前页面的 href (URL)
window.location.hostname 返回 web 主机的域名
window.location.pathname 返回当前页面的路径或文件名
window.location.protocol 返回使用的 web 协议(http: 或 https:)
window.location.assign 加载新文档
JavaScript Window Location
最新推荐文章于 2022-12-09 13:07:30 发布