document.URL 和 windows.location.href的区别

1. 从输出结果上,document.URL 和 windows.location.href 没有区别。
2. 非要说区别的话,你只可以读取document.URL的值,不能修改它。windows.location.href的值你即可以读取也可以修改。
3. windows.location.href是旧的写法,新的标准推荐用document.URL替代。(如果你只是读取的话)

posted @ 2017-02-01 11:25  阿力瓦  阅读(2604)  评论(0编辑  收藏  举报