通过js控制html页面不能右键,复制等

 <script type="text/javascript">
  //Method one
  //<![CDATA[ 
  //document.oncontextmenu=new Function('event.returnValue=false;');
  document.oncontextmenu = function (e) { e = e || window.event; e.returnValue = false; }
  document.onselectstart = new Function('event.returnValue=false;');
  //]]> 
 </script>
<!--Method two-->
<body oncontextmenu="return false" onselectstart="return false"></body>

 

原文链接:https://www.cnblogs.com/jasonzeng/p/4051851.html
本文来源 爱码网,其版权均为 原网址 所有 与本站无关,文章内容系作者个人观点,不代表 本站 对观点赞同或支持。如需转载,请注明文章来源。

© 版权声明

相关文章