Dengarkan url hash ubah javascript

window.onhashchange = function() { 
     //code  
}

window.onpopstate = function() { 
     //code  
}
Pixels