1. 程式人生 > >wordpress怎麽禁止文章復制

wordpress怎麽禁止文章復制

alert ast str 禁止復制 fun 復制 src n) nco

登陸你的網站後臺--點擊菜單欄的“外觀”--點擊“編輯”--在右側,找到footer.php,打開它--在</body>之前加入以下代碼:

1.禁止復制

<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>

2.右鍵復制時顯示提示語

把下面代碼放到footer.php裏即可

<html>
<head><title>防復制</title><meta http-equiv="Content-Type" cont
ent="text/html; charset=utf-8" /></head>
<script>
function stop(){
alert(‘鄙視盜版,尊重版權,人人有責!‘);
return false;
}
document.oncontextmenu=stop;
</script>
<body onselectstart="return false" onpaste="return false" oncop


y="return false;"
oncut="return false;" >
</body>
</html>

wordpress怎麽禁止文章復制