常见location对象方法
1、location.protocol 设置或返回当前 URL 的协议。
2、location.pathname 设置或返回当前 URL 的路径部分。
3、location.host 设置或返回主机名和当前 URL 的端口号。
3、location.search 设置或返回从问号 (?) 开始的 URL(查询部分)。
![](https://img.haomeiwen.com/i5209634/71bdaf31517763c4.png)
常见location对象方法
1、location.protocol 设置或返回当前 URL 的协议。
2、location.pathname 设置或返回当前 URL 的路径部分。
3、location.host 设置或返回主机名和当前 URL 的端口号。
3、location.search 设置或返回从问号 (?) 开始的 URL(查询部分)。
本文标题:location对象
本文链接:https://www.haomeiwen.com/subject/zhdjhltx.html
网友评论