久久人人玩人妻潮喷内射人人-无码少妇一区二区三区-欧美~日韩~国产~中文字幕-性xxxxfreexxxxx欧美丶

系統軟件園 - 專注分享最好的電腦系統軟件!免費安全下載 系統軟件園首頁 | Win7激活工具 | 熱門專題
系統軟件園>您的位置:首頁 > > 系統教程 > 軟件教程 >

【禁止鼠標右鍵代碼】網頁中禁止使用右鍵,禁止復制script代碼大全

更新時間:2018-03-11 18:49:12| 編輯:本站整理 | 信息來源:本站整理|瀏覽數:
在網頁中,辛辛苦苦寫的文章,被別人復制粘貼給盜用去另很多站長感到非常無奈,通常大家復制都會使用選取右鍵復制,或CTRL+C等方式,下面介紹幾種禁止鼠標右鍵代碼,可減少網頁上文章被抄襲的幾率,當然對高手來說,破解也很簡單,不管怎么樣,我們還是一起試試吧。



使用方法:以下代碼加入到<script language=JavaScript>之間</script>

oncontextmenu事件禁用右鍵菜單代碼; 
js代碼:

document.oncontextmenu = function(){
    event.returnValue = false;
}
// 或者直接返回整個事件
document.oncontextmenu = function(){
    return false;
}

onselectstart事件禁用網頁上選取的內容; 
js代碼:

document.onselectstart = function(){
    event.returnValue = false;
}
// 或者直接返回整個事件
document.onselectstart = function(){
    return false;
}

oncopy事件禁用復制; 
js代碼:

document.oncopy = function(){
    event.returnValue = false;
}
// 或者直接返回整個事件
document.oncopy = function(){
    return false;
}

以上三種事件,如果只想單純的禁用鼠標右鍵,和復制粘貼,還可以將它們直接寫到HTML中的body上面;

<body oncontextmenu = "return false" ></body>

<body onselectstart = "return false" ></body>

<body oncopy = "return false" ></body>

禁用鼠標事件

document.onmousedown = function(e){
    if ( e.which == 2 ){// 鼠標滾輪的按下,滾動不觸發
        return false;
    }
    if( e.which==3 ){// 鼠標右鍵
        return false;
    }
}

禁用鍵盤中的ctrl、alt、shift

document.onkeydown = function(){
    if( event.ctrlKey ){
        return false;
    }
    if ( event.altKey ){
        return false;
    }
    if ( event.shiftKey ){
        return false;
    }
}

關鍵就在  

  oncontextmenu='return false'
  ondragstart='return false' 
  onselectstart ='return false' 
  onselect='document.selection.empty()' 
  oncopy='document.selection.empty()' 
  onbeforecopy='return false' 
  onmouseup='document.selection.empty()'

一個更簡單的方法就是在<body>中加入如下的代碼,這樣鼠標的左右鍵都失效了. 

topmargin="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()" 

1.禁止網頁另存為:在<body>后面加入以下代碼: 
<noscript> 
<iframe src="*.htm"></iframe> 
</noscript> 


2.禁止網頁內容復制.粘貼:在<body>中加入以下代碼: 
<body
 onmousemove=/HideMenu()/ oncontextmenu="return false" 
ondragstart="return false" onselectstart ="return false" 
onselect="document.selection.empty()" 
oncopy="document.selection.empty()" onbeforecopy="return false" 
onmouseup="document.selection.empty()">
?

在網站的建設中,文章內容通過技術手段禁止復制只能說是一個輔助作用,保護原創才是正解,目前百度推出了原創保護功能,大家可以去試試哦。

返回頂部


系統軟件園發布的系統鏡像及軟件均來至互聯網,僅供學習和研究使用,不得用于任何商業用途并請在下載后24小時內刪除,如果滿意請聯系版權方購買。
如果您發現本站侵害了您的版權,請立即聯系我們,本站將第一時間進行相關處理。聯系方式(見首頁)
版權聲明|下載聲明 Copyright @ 2016 系統軟件園

主站蜘蛛池模板: 惠来县| 镇雄县| 乃东县| 肥西县| 林州市| 保山市| 兴和县| 寿阳县| 永善县| 扶绥县| 江华| 新田县| 民县| 平乐县| 阿拉尔市| 缙云县| 嘉禾县| 威信县| 汉川市| 通渭县| 东乡| 潞城市| 正蓝旗| 辛集市| 体育| 南投市| 加查县| 祁门县| 沁阳市| 任丘市| 时尚| 清流县| 临江市| 张家口市| 名山县| 金湖县| 清原| 炎陵县| 南华县| 七台河市| 罗城|