javascript window.location 是跨浏览器吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5615273/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 17:46:01  来源:igfitidea点击:

Is javascript window.location crossbrowser?

javascriptdomcross-browserwindow-object

提问by EBAG

Is javascript code window.location functional in all new and old STANDARD POPULAR browsers?

javascript 代码 window.location 在所有新旧标准流行浏览器中都有效吗?

回答by Purrell

window.location, which shares the same structure as document.locationshould be identical between modern browsers for the following properties:

window.location,它共享相同的结构,document.location现代浏览器之间的以下属性应该相同:

Known Differences:

已知差异:

  • Only Webkit has location.originat the time of writing.
  • location.origin在撰写本文时,只有 Webkit 有。

回答by Jim Blackler

I can't say 'all old browsers' since it may not work in Netscape Navigator 0.9 but yeah this is in the standard and is very widely supported.

我不能说“所有旧浏览器”,因为它可能无法在 Netscape Navigator 0.9 中工作,但是这是标准的并且得到了广泛的支持。

回答by Fatih Acet

window.location works in all major browsers

window.location 适用于所有主要浏览器