views:

31

answers:

1

Right now I'm using

if(window.location.hash != '')

Is this foolproof? Or, is there a way to return a Boolean value instead?

+1  A: 

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.

RaYell