网页屏蔽鼠标右键防止复制代码

文章摘要:网页屏蔽鼠标右键防止复制代码: 方法一、 script language=javascript function click(){ if (event.button==2){ alert(禁止使用鼠标右键!!!) } } document.onmou

网页屏蔽鼠标右键防止复制代码:

方法一、

  1. <script language="javascript">
  2. function click(){
  3. if (event.button==2){
  4. alert('禁止使用鼠标右键!!!') 
  5. }
  6. }
  7. document.onmousedown=click
  8. </script>

方法二、

  1. <body onmouseup=document.selection.empty() oncontextmenu="return false" onselectstart="return false" ondragstart="return false" onbeforecopy="return false" oncopy=document.selection.empty()></body>

方法三、

  1. <body  oncontextmenu="return false" onselectstart="return false"></body>
  • 版权声明:本站原创文章,于2020-04-27 21:22,由 发表。
  • 转载请注明出处