window.addEventListener('hashchange', function() { //do it; }) window.addEventListener('hashchange', function() { console.log('Hash was changed!') }, false)