Słuchaj JavaScript Zmień adres URL HASH

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

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