Answers for "disable back history javascript and then enable"

0

how to disable back js

history.pushState(null, null, null);
$(window).on("popstate", function (event) {
  if (!event.originalEvent.state) {
    history.pushState(null, null, null);
    return;
  }
});
Posted by: Guest on March-27-2021
0

prevent history back javascript

// There are numerous reasons why disabling the back button will not really work. Your best bet is to warn the user:
window.onbeforeunload = function() { return "Your work will be lost."; };
Posted by: Guest on August-25-2021

Code answers related to "disable back history javascript and then enable"

Code answers related to "Javascript"

Browse Popular Code Answers by Language