In my application, I have a button that creates an HTTP promise, and on a successful callback refreshes the page (using window.location.reload(true)
). However, this adds a new copy of the page to the browser history, so the back button doesn't work since it's just loading the same page again. Any idea how I can fix this?
I'm trying to support ie8 if possible.
The comments on your question point out that your approach is not optimal. Instead of completely reloading everything, you should have a function that updates the (already loaded) view.
However, if you really insist on using this behaviour, you could use location.replace()
instead, passing it the current URL. This will essentially reload the page without adding a duplicate in the history stack.