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.