禁止右键菜单和选择复制

来源:互联网 发布:linux 清理tmp文件 编辑:程序博客网 时间:2024/06/10 18:13
Code:
  1. <html>  
  2.  <head>  
  3.   <title></title>  
  4. </head>  
  5.    <script language="JavaScript">  
  6.        function  click(e){  
  7.           if(window.event)  {  
  8.              if(event.button==2 || event.button==3){  
  9.               alert("xxx");  
  10.               return false;  
  11.             }  
  12.           }  
  13.        }  
  14.      document.onmousedown=click;  
  15.    </script>  
  16.    <body oncontextmenu=self.event.returnValue=false onselectstart="return false">  
  17.     aaaaaaaaaaa  
  18.   </body>  
  19. </html>  
原创粉丝点击