怎么禁止网页被复制、另存为

禁止右键和复制

<script language="Javascript">  
document.oncontextmenu=new Function("event.returnValue=false");  
document.onselectstart=new Function("event.returnValue=false");  
</script>

禁止ctrl+s,ctrl+u,f12

<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
</script>
<script>
$(document).keydown(function(e){
   if( e.ctrlKey  == true && e.keyCode == 83 ){
      console.log('ctrl+s');
      return false; // 禁止ctrl+s
   }
   if( e.ctrlKey  == true && e.keyCode == 85 ){
      console.log('ctrl+u');
      return false; // 禁止ctrl+u
   }
   if( e.keyCode == 123 ){
      console.log('f12');
      return false; // 禁止f12
   }
});
</script>

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: