Answers for "javascript preventdefault not stopping page refresh"

C#
8

prevent reload javascript

window.onbeforeunload = function() {
  return "Dude, are you sure you want to leave? Think of the kittens!";
}
Posted by: Guest on March-04-2020
0

prevent page refresh

<script type="text/javascript">
    window.onbeforeunload = function() {
        return "Dude, are you sure you want to leave? Think of the kittens!";
    }
</script>
Posted by: Guest on March-24-2022

Code answers related to "javascript preventdefault not stopping page refresh"

C# Answers by Framework

Browse Popular Code Answers by Language