当前位置:开发者网络 >> 技术教程 >> ASP教程 >> ASP应用 >> 内容
精彩推荐
分类最新教程
分类热点教程
  
互联网页面浏览限制实现总结 (2)
作者:未知
日期:2005-11-18
人气:
投稿:(转贴)
来源:未知
字体:
收藏:加入浏览器收藏
以下正文:
2.不能展开右键,不能全选,不能复制的实现
<body oncontextmenu="window.event.returnValue=false" 

onkeypress="window.event.returnValue=false" 

onkeydown="window.event.returnValue=false" 

onkeyup="window.event.returnValue=false" 

ondragstart="window.event.returnValue=false" 

onselectstart="event.returnValue=false">
... 

</body>


3.禁止页面正文内容被选取

<body oncontextmenu="return false" ondragstart="return false" 
onselectstart ="return false" onselect="document.selection.empty()" 
oncopy="document.selection.empty()" onbeforecopy="return 

false"onmouseup="document.selection.empty()">


4.避免别人把网页放在框架中

<script language=“javascript”><!--if (self!=top){top.location=self.location;}-->< /script>


5.禁示查看源代码

<frameset> 

<frame src="你要保密的文件的URL"> 

</frameset>


6.关闭输入法

<input style="ime-mode:disabled">


7.禁止图片下载

这里的最后加入:

oncontextmenu="return false" ondragstart="return false" onselectstart="return 
false" scroll="auto"


8.禁止缓存

在HEAD里加入:

<meta http-equiv="Expires" CONTENT="0"> 

<meta http-equiv="Cache-Control" CONTENT="no-cache"> 


<meta http-equiv="Pragma" CONTENT="no-cache">


相关文章: