1. 程式人生 > >web 頁面防複製防拷貝

web 頁面防複製防拷貝

1、禁止另存為
<NOSCRIPT><IFRAME SRC=*.html></IFRAME></NOSCRIPT>


2、防止複製
oncopy="return false;" oncut="return false;"


3、防止選擇
<body onselectstart="return false">


4、徹底遮蔽滑鼠右鍵(好像不行)
oncontextmenu="window.event.returnvalue=false"

改為oncontextmenu="window.event.returnvalue=false" 可以

5、這段程式碼可以遮蔽右鍵,防複製等!(

引用)
<body marginwidth="0" marginheight="0" oncontextmenu="return false" ondragstart="return

false" onselectstart ="return false" onselect="document.selection.empty()"

oncopy="document.selection.empty()" onbeforecopy="return false"

onmouseup="document.selection.empty()">
<noscript><iframe src=*></iframe></noscript>


6、防滑鼠右擊程式碼
                  <SCRIPT language=JavaScript>
                  function click(e) {
                  if (document.all) {
                  if (event.button==2||event.button==3) {
                  oncontextmenu=/'return false/';
                  }
                  }
                  if (document.layers) {
                  if (e.which == 3) {
                  oncontextmenu=/'return false/';
                  }
                  }
                  }
                  if (document.layers) {
                  document.captureEvents(Event.MOUSEDOWN);
                  }
                  document.onmousedown=click;
                  document.oncontextmenu = new Function(/"return false;/")
                  </SCRIPT>