互联网页面浏览限制实现总结

2005-07-14 09:59 作者:不祥 责任编辑:moningfeng


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.禁止图片下载
  在<body......>这里的最后加入:

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

键盘也能翻页,试试“← →”键
分享到: QQ空间 新浪微博 腾讯微博 更多
相关文章
相关文章
相关软件