0

Possible Duplicate:
Change the URL in the browser without loading the new page using JavaScript

Example of what I'm trying to do:

User is at /things/list, then clicks 'new thing' which takes them to /things/new they fill in the needed info for the thing click save and the url changes to /things/123 and then they click the back button in their browser and it takes them to /things/list instead of /things/new. Is something like this possible?

Community
  • 1
  • 1

1 Answers1

5

If the code that goes from /things/new to /things/123 uses window.location.replace('/things/123'), then the back button will go to things/list like you want because /things/new in the browser history will have been replaced in the history list.

jfriend00
  • 580,699
  • 78
  • 809
  • 825