-1

我正在尝试使我的网页受 DO-NOT-COPY 保护.. 我得到以下代码.. 它适用于 chrome 和 IE,但不适用于 firefox..

<script type="text/JavaScript">
    function NoCopy(e)
    {
        return false
    }
    function ReActivate()
    {
        return true
    }

    document.onselectstart = new Function ("return false")

    if(document.sidebar)
    {
        document.onmousedown = NoCopy
        document.onclick = ReActivate
    }</script>

谁能帮我这个??

提前致谢

4

2 回答 2

0

您不能使用 Javascript 限制用户复制文本。如果内容是从您的服务器发送的,那么用户可以用它做任何事情。

用户可以在不支持 Javascript 的网站上查看您的网站,或者用户可以在 php 中使用 CURL 函数并阅读内容。有很多选择。所以使用版权保护您的内容。

于 2012-07-18T09:18:52.877 回答
0

那么如果你想通过选择文本来防止复制,上面的方法并不好。而是添加一个copyright notice/license或我建议您使用CSS

body {
   -webkit-touch-callout: none;
   -webkit-user-select: none;
   -khtml-user-select: none;
   -moz-user-select: none;
   -ms-user-select: none;
   user-select: none;
}
于 2012-07-18T09:13:37.390 回答