Sunday, November 10, 2013

Right Click Disable Code To Stop Content Copying

Posted by Savita Sathe
It is a long argument that whether you should disable your right click or not. But overtime many felt that it should be disable to stop copying of your hard written content. So here is the code to stop right click on your written content.

        <script language="javascript">
        document.onmousedown=disableclick;
        status="Right Click Disabled";
        Function disableclick(event)
        {
          if(event.button==2)
           {
             alert(status);
             return false;   
           }
        }
        </script>

Another code which will act like same but will display a pop up button is as follows:

    <script language="JavaScript">
    <!-- http://www.nonstupidblog.in -->
        var message = "function disabled";
        function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){     alert(message); return false; }
        if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {     alert(message);     return false; } }
        document.onmousedown = rtclickcheck;
    </script>

 You just need to paste any of these codes in between your <body> and
</body>
Post a Comment