Answers for "how to prevent page change when i refresh by javascript"

C#
1

prevent page refresh

// Can be implemented via window.onbeforeunload.
// For example:
<script type="text/javascript">
    window.onbeforeunload = function() {
        return "Are you sure you want to leave?";
    }
</script>
Posted by: Guest on July-03-2021
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 "how to prevent page change when i refresh by javascript"

C# Answers by Framework

Browse Popular Code Answers by Language