防止被Print Screen
<script language="javascript">
<!--
function testclip(){
try {
if(clipboardData.getData("Text")||clipboardData.getData("HTML")||clipboardData.getData("URL"))
{
null;
}
}
catch(e){
clipboardData.setData("Text","")
}
setTimeout("testclip()",500)
}
testclip();
//-->
</script>
以上代码都加在</head>前面
<script language="javascript">
<!--
function testclip(){
try {
if(clipboardData.getData("Text")||clipboardData.getData("HTML")||clipboardData.getData("URL"))
{
null;
}
}
catch(e){
clipboardData.setData("Text","")
}
setTimeout("testclip()",500)
}
testclip();
//-->
</script>
以上代码都加在</head>前面
本文介绍了一段JavaScript代码,该代码旨在通过定时检查剪贴板数据来防止用户使用PrintScreen功能复制网页内容。虽然这种方法可能有一定的局限性,但它提供了一个思路来保护网站上的原创材料不被轻易复制。
1万+

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



