Wednesday 27 February 2019

How to prevent browser back button with alert to user. ?

<script type="text/javascript">
          history.pushState(null, null, document.URL);
          window.addEventListener('popstate', function () {
              alert("Please proceed with Main button");
              history.pushState(null, null, document.URL);

          });

No comments:

Post a Comment