I am building a web app, Where I want to do a few auto-complete tasks. For example, a tutorial on how to use the app. I want to change the URL hash on each step, check the hash and load the next content. But when I change the URL hash, the page does not reload and my code does not run a second time.
if( location.hash == '#step2' ){
// Show Tutorial
}
So, how can I reload the page after the URL hash change?
This function will run every time the hash value changes. Anyway if you still want to reload the page you can do so by putting location.reload() inside the window.onhashchange event.