JavaScript mendeteksi perubahan hash url

window.addEventListener("onhashchange", function(){
    //url hash # has changed
});
Grepper