Answer the question
In order to leave comments, you need to log in
How to prevent the return to the old one after sending the data?
Friends, such a problem has arisen here, I need to prohibit the user from returning to the previous page. I say in advance that the code
history.pushState(null, null, location.href);
window.onpopstate = function(event) {
history.go(1);
};
Does not work normally, after refreshing the page again allows you to go back. Answer the question
In order to leave comments, you need to log in
mdn
There is no way to clear the session history or to disable the back/forward navigation from unprivileged code.
Make the return just pointless. For example, a one-time key. The first visit to the page - there is a key, everything is done as standard, but it is erased. Repeated handling of the same key results in an error, because it has already been erased.
Everything else is an elegant attempt to hide behind a mop.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question