This Season
 

How to Disable Copy & Paste

How to Disable Copy & Pastethumbnail
Protect your website from theft.

Anyone who visits your website can copy and paste your text, images or source code. To prevent this, you can add codes to your site that prevent visitors from right-clicking anywhere on your pages or images; selecting the text on your website; or viewing, copying and pasting your source code. Although these codes are useful tools, keep in mind that it is impossible to guarantee that your website is completely protected. Someone with advanced computer knowledge can find a way around these tricks.

Related Searches:
    Difficulty:
    Easy

    Instructions

      • 1

        Copy either of the following codes and paste it within the "head" tags (<HEAD> </HEAD>) of your HTML document. This will prevent visitors from right-clicking anywhere on your Web pages. (Note: This first code works only on newer Internet browsers.)

        <script language="JavaScript1.1">

        // distributed by http://www,hypergurl.com <!-- var debug = true; function

        right(e) { if (navigator.appName == 'Netscape' && (e.which == 3 || e.which

        == 2)) return false; else if (navigator.appName == 'Microsoft Internet Explorer'

        && (event.button == 2 || event.button == 3)) { alert('This Page is fully

        protected!'); return false; } return true; } document.onmousedown=right; if (document.layers)

        window.captureEvents(Event.MOUSEDOWN); window.onmousedown=right; //--></script>

        Or use this code:

        <SCRIPT TYPE="text/javascript">

        <!--

        //Disable right click script

        //visit http://www.rainbow.arch.scriptmania.com/scripts/

        var message="Sorry, right-click has been disabled";

        ///////////////////////////////////

        function clickIE() {if (document.all) {(message);return false;}}

        function clickNS(e) {if

        (document.layers||(document.getElementById&&!document.all)) {

        if (e.which==2||e.which==3) {(message);return false;}}}

        if (document.layers)

        {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}

        else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

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

        // -->

        </SCRIPT>

      • 2

        Copy the following code and paste it within the "head" tags (<HEAD> </HEAD>) of your HTML document to prevent visitors from selecting text on your website. This is important because disabling right-click does not stop people from selecting text with their left mouse button and then clicking "Copy" from their browser's menu.

        <SCRIPT TYPE="text/javascript">

        <!--

        //Disable select-text script (IE4+, NS6+)

        //visit http://www.rainbow.arch.scriptmania.com/scripts/

        ///////////////////////////////////

        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>

      • 3

        Copy this code and paste it directly after your <HEAD> tag in your HTML document. If a visitor right-clicks on one of your images, a box will pop up saying, "Sorry, right-click is disabled."

        <script language="JavaScript">

        // distributed by http://hypergurl.com <!-- var popup="Sorry, right-click

        is disabled.\n\nThis Site Copyright ©2000"; function noway(go) { if

        (document.all) { if (event.button == 2) { alert(popup); return false; } } if (document.layers)

        { if (go.which == 3) { alert(popup); return false; } } } if (document.layers)

        { document.captureEvents(Event.MOUSEDOWN); } document.onmousedown=noway; // -->

        </script>

      • 4

        Place "invisible" tags around your entire HTML document to hide your source code from visitors. Without this code (or something similar), visitors can view, copy and paste your source code by clicking on "Menu," "View" and then "Source." Thus, your page should look like this: <INVISIBLE>Your HTML document goes here</INVISIBLE>

    Related Searches

    References

    • Photo Credit woman hands typing on laptop keyboard image by .shock from Fotolia.com

    Read Next:

    Comments

    You May Also Like

    Follow eHow

    Related Ads