xxxxxxxxxx
It is not advised, but if you want to completely prevent the user from
refreshing the page you can use:
setInterval(function(){
window.location.reload();
window.stop();
},100)
xxxxxxxxxx
window.onbeforeunload = function() {
return "Dude, are you sure you want to leave? Think of the kittens!";
}
xxxxxxxxxx
// Can be implemented via window.onbeforeunload.
// For example:
<script type="text/javascript">
window.onbeforeunload = function() {
return "Are you sure you want to leave?";
}
</script>
xxxxxxxxxx
<script type="text/javascript">
window.onbeforeunload = function() {
return "Dude, are you sure you want to leave? Think of the kittens!";
}
</script>