Created
July 17, 2013 22:13
-
-
Save mbjordan/6025026 to your computer and use it in GitHub Desktop.
Simply read the hash both on page load and for every hash change.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onhashchange = doChange; | |
window.onload = doChange; | |
function doChange() { | |
var _hash = window.location.hash.replace("#!", ""); | |
console.log(_hash); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://developer.mozilla.org/en-US/docs/Web/API/window.onhashchange