kratos2333
2/16/2017 - 9:21 PM

Using fragment identifier # is the key for the single page application

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");
    }
});