window对象

2021-05-25  本文已影响0人  湘兰沅芷

传参前边的URL:window.location.origin
origin: "https://blog.csdn.net"

域名 + 端口:window.location.host
host: "blog.csdn.net"

当前URL:window.location.href
href: "https://blog.csdn.net/xh_960125/article/details/105140442"

协议:window.location.protocol
protocol: "https:"

域名:window.location.hostname
hostname: "blog.csdn.net"

端口:window.location.port
port: ""

路径部分:window.location.pathname
pathname: "/xh_960125/article/details/105140442"

请求的参数:window.location.search
search: ""

上一篇下一篇

猜你喜欢

热点阅读