今天公司要求禁止别人拷贝我们网站上的东西,所以就弄了些js代码 功能就是禁止用户选择内容 从而达到禁止复制的效果代码如下:
<script type="text/javascript">
function disableselect(e){
return false}
function reEnable(){return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>
本文介绍了一种通过JavaScript实现禁止用户选择网页内容的方法,以此来防止网页内容被复制。代码适用于IE4+及NS6浏览器。
3826

被折叠的 条评论
为什么被折叠?



