13

I know I can add a hash to the end of the url like so:

window.location.hash = '#myFancyHash';

But for various reasons I need to fully reload the page. On some browsers this works fine:

window.location = window.location.href + '#myFancyHash';

But others refuse to reload the page since it sees the new url as just a hash version.

Is there any way to force all browsers to redirect (reload) the page anew?

1 Answers1

15
window.location.hash = '#myFancyHash';
window.location.reload()

This is cause a reload with the new hash

Umur Kontacı
  • 35,403
  • 8
  • 73
  • 96