Reputation: 1
Let's say I have this url: https://meta.stackexchange.com/users/login?returnurl=123456
How do I replace the 123456 part without reloading the page?
I found the replacestate option but from what I understand it replaces the whole URL, not just the part of the URL that I want.
Upvotes: 0
Views: 60
Reputation: 324
window.history.pushState({}, 'title' , window.location.href.replace('123456','not123456'));
Upvotes: 3