Search code examples
javascripthashwindowlocationdefined

Javascript window.location.hash is defined?


Is there some way I can tell whether window.location.hash is defined?

If it is set, then I will be getting the value of the variable, and using it to display extra content on the page.


Solution

  • if(window.location.hash) {
        // do stuff!
    }