dede网站浏览禁止右键、查看源码、复制的方法

作者: 小默 分类: Dedecms交流, 网站建设 发布时间: 2019-12-17 15:13 ė
Warning: Use of undefined constant the_views - assumed 'the_views' (this will throw an Error in a future version of PHP) in /www/wwwroot/www.seohave.com/wp-content/themes/TangStyle/single.php on line 19
11,400 人访问
6没有评论

代码一
当按下鼠标左键进行选择或点击右键或按CTRL键时,会弹出对话框:
=================================
<!–禁止复制–>
<SCRIPT LANGUAGE=javascript>
function click() {
alert(‘禁止你的左键复制!’) }
function click1() {
if (event.button==2) {alert(‘禁止右键点击~!’) }}
function CtrlKeyDown(){
if (event.ctrlKey) {alert(‘不当的拷贝将损害您的系统!’) }}
document.onkeydown=CtrlKeyDown;
document.onselectstart=click;
document.onmousedown=click1;
</SCRIPT>
<!–禁止复制–>

代码二【推荐】:
当按下鼠标时,无任何反应,从而保护好页面:
==================================
<!–无法复制–>
<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()”> 
<!–无法复制–>

以下代码让网页无法保存,但可以另存。

本文出自 建站seo运营,转载时请注明出处及相应链接。

本文永久链接: https://www.seohave.com/629.html

0

发表回复

Ɣ回顶部