window.location和window.location.href区别详解
来源:互联网 发布:u盘照片导入mac 编辑:程序博客网 时间:2024/06/06 18:19
window.location是一个对象,包含属性有
hash 从井号 (#) 开始的 URL(锚)
host 主机名和当前 URL 的端口号
hostname 当前 URL 的主机名
href 完整的 URL
pathname 当前 URL 的路径部分
port 当前 URL 的端口号
protocol 当前 URL 的协议
search 从问号 (?) 开始的 URL(查询部分)
获取window.location.href是最常用的
location是location.href的简写,无论是访问还是赋值,从功能上,locatin等于location.href
而从本质上,location是一个对象,location.href是一个属性
从chrome的console里面输入window.location.href和window.location你就能很清楚的看到两者的不同
window.location.href
window.location
0 0
- window.location和window.location.href区别详解
- window.top.location.href 和 window.location.href 的区别
- window.top.location.href 和 window.location.href 的区别
- window.location.href和window.top.location.href的区别
- window.location.href和window.top.location.href的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- window.location.href和window.location.replace的区别
- 安卓开发:上下文菜单
- 用java写递归程序,从1打印到n
- 《软技能——代码之外的生存指南》读书笔记之职业(二)
- 一篇文章学懂Shell脚本
- C++:带有const修饰的指针解读
- window.location和window.location.href区别详解
- Java移位运算,你可能不知道的运算
- 产品经理常见的6大文案陷阱
- HDU 2014 青年歌手大奖赛_评委会打分
- 第4章 初始不是需求阶段
- (洛谷P2014 选课)<树形DP>
- RocketMQ源码解析:Message拉取&消费(上)
- java实现百万级数据导出excel
- 微信小程序开发手记之八:一个小程序上线后的总结(下)