javascript中window.location和window.location.href的区别
2012-10-24 13:19
375 查看
window.location是页面的位置对象,window.location.href是location的一个属性值,并且它是location的默认属性。就是说对window.location直接赋值一个url实际上就是对window.location.href赋值。
location对象除了有href属性外还有很多其他属性和方法,而href就是一个字符串。只不过修改location的href会触发浏览器加载href所指向的url。
location对象除了有href属性外还有很多其他属性和方法,而href就是一个字符串。只不过修改location的href会触发浏览器加载href所指向的url。
相关文章推荐
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- javascript 打开页面window.location.href和window.open的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- javascript中window.open()与window.location.href的区别
- window.location.Reload()和window.location.href 区别
- window.location.href和document.location.href、document.URL的区别
- window.location.href,window.open,<a href="/"></a>打开新页面区别
- javascript中window.open()与window.location.href的区别
- window.location.Reload()和window.location.href 区别
- window.location.href和window.location.replace的区别
- window.opener.location.reload() and href的区别
- a href=#与 a href=javascript:void(0) 的区别,以及location.href含义
- window.top.location.href 和 window.location.href 的区别
- window.location.href和window.location.replace的区别