通过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>

 

posted @ 2014-10-26 12:42  ぶ会编程  阅读(1472)  评论(0编辑  收藏  举报