新聞中心
WordPress如何禁止復(fù)制網(wǎng)頁文章內(nèi)容方法
在這個網(wǎng)絡(luò)信息開放的時代,網(wǎng)絡(luò)上各式各樣的資源給我們帶來了無窮無盡的方便。但是在給我們帶來方便的同時,也會涉及到一些關(guān)于版權(quán)的問題。比如原創(chuàng)的文章,如果在網(wǎng)絡(luò)上被瘋狂復(fù)制轉(zhuǎn)載且不注明作者,則會對文章原創(chuàng)人帶來損失。對于網(wǎng)站建設(shè)也是這樣,一篇優(yōu)秀的文章,我們在分享的同時,有時候并不希望被人隨意復(fù)制黏貼。對于wordpress這個程序,無憂主機(jī)小編之前有給客戶處理一個不讓他人隨便復(fù)制網(wǎng)站內(nèi)容的方法。下面小編就給大家分享一下。 首先實(shí)現(xiàn)鼠標(biāo)右鍵防止點(diǎn)擊復(fù)制方法: 在wordpress根目錄下找到找到footer.php文件用EditPlus或者其他編輯器打開,把以下代碼復(fù)制上去: <html> <head><title>防復(fù)制</title><meta http-equiv="Content-Type" cont ent="text/html; charset=utf-8" /></head> <script> function stop(){ alert('尊重版權(quán),人人有責(zé)!'); return false; } document.oncontextmenu=stop; </script> <body onselectstart="return false" onpaste="return false" oncop y="return false;" oncut="return false;" > </body> </html> 如果是禁止所用人復(fù)制功能還是在wordpress根目錄下找到footer.php文件用EditPlus或者其他編輯器打開,把以下代碼復(fù)制上去 <script type="text/Javascript"> <!-- document.oncontextmenu=function(e){return false;}; document.onselectstart=function(e){return false;}; //--> </script> <style> body{ -moz-user-select:none; } </style> <SCRIPT LANGUAGE=javascript><!-- if (top.location != self.location)top.location=self.location; // --></SCRIPT> <noscript><iframe src=*.html></iframe></noscript> 小編總結(jié)下以上的代碼可以實(shí)現(xiàn)三個功能,第一個實(shí)現(xiàn)禁止鼠標(biāo)左鍵選取內(nèi)容第二禁止鼠標(biāo)右鍵復(fù)制最后就是禁止使用ctrl按鍵進(jìn)行復(fù)制,希望小編能給大家?guī)韼椭?。感謝大家對無憂主機(jī)的支持。 定
本文地址:http://m.love62.cn/wordpress/14296.html
![1](/wp-content/themes/starow_z/img/o-1.png)
![1](/wp-content/themes/starow_z/img/o-2.png)
![1](/wp-content/themes/starow_z/img/o-3.png)
![1](/wp-content/themes/starow_z/img/o-4.png)
![1](/wp-content/themes/starow_z/img/o-5.png)
![1](/wp-content/themes/starow_z/img/o-6.png)
![1](/wp-content/themes/starow_z/img/o-7.png)