javascript url hash on change code example
Example 1: javascript change url hash
window.location.hash = '#hash_value';
Example 2: javascript detect URL hash change
window.addEventListener("onhashchange", function(){
//url hash # has changed
});