Reputation: 11
Because of some requirement, Calling of My pages is like
/url/home
/url/page1
/url/page1?abc=1
/url/page1?abc=2
As a result when i click on browserback from "/url/page1?abc=2", it goes to " /url/page1?abc=1" and so on.
I want when i click browserback from "/url/page1?abc=2" it should go stright to "/url/home", So i wanted to remove 2 urls "/url/page1" & /url/page1?abc=1" from history.
Please help
Upvotes: 0
Views: 70
Reputation: 4525
you can use this one instead of removing browser history
window.location.replace(URL);
It will replace the current document with the one at the provided URL.
reference: https://developer.mozilla.org/en-US/docs/Web/API/window.location
Upvotes: 1