Using fragment identifier # is the key for the single page application
// The hashchange will be triggered once the url updated with the #something
window.addEventListener("hashchange", function(){
if(window.location.hash === '#bookmark1'){
console.log("Go to bookmark1");
}
if(window.location.hash === '#bookmark2'){
console.log("Go to bookmark2");
}
});