开发者

Is javascript window.location crossbrowser?

开发者 https://www.devze.com 2023-02-23 19:05 出处:网络
Is javascript code window.location functional in all new and old STANDARD POP开发者_开发技巧ULAR browsers?window.location, which shares the same structure as document.location should be identical betw

Is javascript code window.location functional in all new and old STANDARD POP开发者_开发技巧ULAR browsers?


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

  • hash (except in FireFox ~< 16.0 where there was a bug with encoding)
  • hostname
  • href
  • pathname
  • port
  • protocol
  • search
  • reload()
  • replace()

Known Differences:

  • Only Webkit has location.origin at the time of writing.


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.


window.location works in all major browsers

0

精彩评论

暂无评论...
验证码 换一张
取 消