I'm building a text editor in my website, the workflow is as follows.
/list
, the user picks an entry they want to edit from a list which takes them to /edit/[article_id]
./edit/[article_id]
which by now reflects the edited work. The server also activates a flash message on the page to indicate the edit was successful.By this point, the user probably wants to go back to /list
and clicks the browser's Back button. This will take them back to the editor repeatedly depending on how many times they submitted.
I've tried putting a Back button somewhere on the page, but a good many users simply ignore it.
I'd rather not make the submission posted via AJAX, since that would also affect the flash message system.
What I like to do, is replace the last entry on the history list when the user submits, without changing its length. Is it possible?
The history property of the Window object refers to the History object. It contains the browser session history, a list of all the pages visited in the current frame or window. Since Window is a global object and it is at the top of the scope chain, so properties of the Window object i.e. window.
Try this
window.location.replace(url);
after using replace()
the current page will not be saved in session history, meaning the user won't be able to use the Back button to navigate to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With