用JavaScript制作的NoCopy函数在firefox中不起作用

时间:2012-07-18 09:10:20

标签: javascript html function firefox

我正在努力让我的网页不受版权保护..我得到了以下代码..它适用于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>

任何人都可以帮我解决这个问题吗?

提前致谢

2 个答案:

答案 0 :(得分: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;
}

答案 1 :(得分:0)

您无法限制用户使用Javascript复制文本。如果内容是从您的服务器发送的,那么用户可以对此进行任何操作。

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

相关问题