Frontpage网页设计中的两个问题

[复制链接]
查看11 | 回复0 | 2009-1-30 06:28:38 | 显示全部楼层 |阅读模式
我在设计自己的网站,用的frontpage和dreamweaver,不想让自己辛辛苦苦制作的网站让别人轻易拷贝,实现以下两种功能;1)屏蔽另存为功能;2)屏蔽选择并复制功能。我从网站上下载了很多例子,但是都不好,因为我不懂语言,请具体写清楚语句,并且详述把语句应该放在什么地方。测试成功以后,奖赏100分。着急用。

                                                                                                在<BODY></body>这间加入:<script language="JavaScript"> <!-- function key(){ if(event.shiftKey){ window.close();} //禁止Shift if(event.altKey){ window.close();} //禁止Alt if(event.ctrlKey){ window.close();} //禁止Ctrl return false;} document.onkeydown=key; if (window.Event) document.captureEvents(Event.MOUSEUP); function nocontextmenu(){ event.cancelBubble = true event.returnValue = false; return false;} function norightclick(e){ if (window.Event){ if (e.which == 2 || e.which == 3) return false;} else if (event.button == 2 || event.button == 3){ event.cancelBubble = true event.returnValue = false; return false;} } //禁右键 document.oncontextmenu = nocontextmenu; // for IE5+ document.onmousedown = norightclick; // for all others //--> </script> 就可以了,以下你的原文件,帮你加了上去的,你可以试试。附件:123456.htm
                                       
提问者对答案的评价:

                                                                                                在<body>中加入下面代码,可以屏蔽保存网页,选择,复制等操作要记住,需要切换至html编辑区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>...</body>标签之间加入如下代码,可以使“另存为”命令不能顺利执行。
<noscript>
<iframe scr=″*.htm″></iframe>
</noscript> 但是会产生缓存文件,使用以下代码,可禁止缓存:在<BODY></body>这间加入: htm网页
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="wed, 26 feb 1997 08:21:57 gmt">
或者<meta http-equiv="expires" content="0">
asp网页
response.expires = -1
response.expiresabsolute = now() - 1
response.cachecontrol = "no-cache"
php网页
header("expires: mon, 26 jul 1997 05:00:00 gmt");
header("cache-control: no-cache, must-revalidate");
header("pragma: no-cache");禁止复制:在<BODY></body>这间加入: <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>
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行