Ouça o JavaScript de Hash Hash URL

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

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