Disable Page Refresh in HTML using Javascript
The following script disables Mouse Right-Click , F5 key and CTRL-R:
<html>
<body oncontextmenu="return false">
<script type="text/javascript">
window.onload = function () {
document.onkeydown = function() {
switch (event.keyCode) {
case 116 : // F5 Key
event.returnValue = false;
event.keyCode = 0;
return false;
case 82 : // CTRL-R
if (event.ctrlKey) {
event.returnValue = false;
event.keyCode = 0;
return false;
}
}
}
}
</script>
</body>
Hello, World!
</html>