Right now I'm using
if(window.location.hash != '')
Is this foolproof? Or, is there a way to return a Boolean value instead?
Right now I'm using
if(window.location.hash != '')
Is this foolproof? Or, is there a way to return a Boolean value instead?
window.location.hash
will return empty string if the hash symbol is present in the URL but it doesn't have anything on it's right side. If there's a value it will return the value with the hash symbol as first character. This might be a bit confusing in certain situations.
Part from that I'd say it's a pretty solid way of using it.