Answer the question
In order to leave comments, you need to log in
How to remove "#" from url and everything after it?
Hello.
Can you please tell me how to remove "#" from the url and everything that comes after it?
For example, there is a url like this: somesite.com/direct/#el-target04
How can I make it look like this when the page is reloaded: somesite.com/direct ?
Trying to implement with:
window.location.hash
Thanks.
upd_01
Found this solution:
history.pushState('', document.title, window.location.pathname);
Answer the question
In order to leave comments, you need to log in
history.pushState("", document.title, window.location.pathname);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question