Skip to main content
formatting and omit window
Source Link
Timo Tijhof
  • 10.2k
  • 6
  • 37
  • 52

Just to clarify, you can't do window.location.split('#')location.split('#'), because window.locationlocation is an object, not a string. But you can do window.location.href.split('#');location.href.split('#'); because window.location.hreflocation.href is a string.

Just to clarify, you can't do window.location.split('#'), because window.location is an object, not a string. But you can do window.location.href.split('#'); because window.location.href is a string.

Just to clarify, you can't do location.split('#'), location is an object, not a string. But you can do location.href.split('#'); because location.href is a string.

Source Link
Chadams
  • 1.9k
  • 1
  • 18
  • 15

Just to clarify, you can't do window.location.split('#'), because window.location is an object, not a string. But you can do window.location.href.split('#'); because window.location.href is a string.