Jquery disables right click function masking F5 refresh

  • 2020-03-30 02:22:42
  • OfStack

1. Disable right-click function
 
$(document).ready(function() { 
$(document).bind("contextmenu",function(e) { 
alert("sorry! No right-clicking!"); 
return false; 
}); 
}); 

2. Block F5 to refresh
 
$(document).ready(function() { 
$(document).bind("keydown",function(e){ 
e=window.event||e; 
if(e.keyCode==116){ 
e.keyCode = 0; 
return false; 
} 
}); 
}); 

Related articles: