4

I would like to delete the previous history state, after the page is loaded.


This is a separate question from my other question; not merely an alternative.

Jack P.
  • 11,487
  • 1
  • 29
  • 34
  • Maybe this is helpful http://stackoverflow.com/questions/2190808/how-to-clear-browsers-ie-firefox-opera-chrome-history-using-javascript-or-j – Koen Peters May 03 '13 at 22:52

1 Answers1

7

If you're loading new page via JS, you can replace its location to use the same history entry:

window.location.replace(url);

See this answer.

Another way is to use history.replaceState.

Denis Malinovsky
  • 5,840
  • 1
  • 22
  • 17