追风小子

相信自己、永不言弃!

  博客园 :: 首页 :: 新随笔 :: 联系 :: :: 管理 ::

1、禁止右键菜单

 1 <script type="text/javascrpt" language="javascript">
 2         //方法一
 3         function noMenuOne()
 4         {
 5                 alert('禁止右键菜单!');
 6                 return false;
 7         }
 8         document.oncontextmenu = noMenuOne;
 9         //方法二
10         function noMenuTwo()
11         {
12                 if(event.button == 2)
13                 {
14                         alert('禁止右键菜单!');
15                         return false;
16                  }
17          }
18          document.onmousedown = noMenuTwo;
19 </script>

2、禁止复制(Ctrl+C)

1 <script type="text/javascript" language="javascript">
2         function noCopy()
3         {
4                 alert("禁止使用Ctrl+C进行复制操作!");
5                 event.returnValue = false;
6         }
7 </script>
8 //<body oncopy = "noCopy()">

3、禁止另存为
在<body></body>之间加入代码
<noscript><iframe src='*.htm'></iframe></noscript>

4、禁止缓存
     禁止缓存 在页面中使用HTML标记,如下面:

1   <HEAD>
2         <META http-equiv=Pragma content=no-cache>
3         <META http-equiv=Cache-Control content=no-cache>
4         <META http-equiv=Expires content=0>
5    </HEAD>

 

posted on 2012-05-18 10:06  追@风  阅读(605)  评论(2)    收藏  举报