I'm using this code
$("#reset_filter").on("click", function(e) {
window.location.hash = "";
window.location.reload();
});
for reset the URL on the page but because of (window.location.hash) on the end of the URL I always get #. Is it possible somehow to remove the hash from the URL? I already have tried with
window.location.href.substr(0, window.location.href.indexOf('#'))
and
window.location.href.split('#')[0]
but it was not working, any proposition and help please.
window.location, but it triggers a page refresh, hence the addendum. Also read the second-ranked answer. It may not solve artur's problem, but it gives the only correct answer (though I'd love to be proven wrong), and this question is still a duplicate.