I have URL like: http://example.com#something, how do I remove #something, without causing the page to refresh?
http://example.com#something
#something
I attempted the following
I think, it would be more safe
if (window.history) { window.history.pushState('', document.title, window.location.href.replace(window.location.hash, '')); } else { window.location.hash = ''; }