No copy paste.

By Kerrie on Jan 26, 2011

Simple little code,
prevents guests from copying and pasting.

<script language="JavaScript">
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("Please don't steal my stuff!!!");
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
</script> 

Comments

Sign in to comment.
Korvin   -  Oct 19, 2011

Standard HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <title></title>
        <link rel='stylesheet' href='css source' />
        <script src='Script Source'></script>
        <script>
            All that jazz;
        </script>
    </head>
    <body>
        Content
    </body>
</html>

Because you don't understand this, you need to (at this point) completely give up of JavaScript and learn static HTML. If you don't you will NEVER comprehend ANY web development language.

 Respond  
stop   -  Aug 24, 2011

wader, where can i found that

?? can u type here step by step. thnx :D
 Respond  
Wade   -  Aug 03, 2011

Stop you need to paste it into the

tags of a html document :)
 Respond  
stop   -  Aug 03, 2011

Hi im newbie in javaS. uh where do i paste that code?

 Respond  
Callumlord   -  Mar 26, 2011

Yeh but will it stop it a in channel?

 Respond  
sunslayer   -  Feb 22, 2011

heres something to prevent CTRL+C (in jQuery)

$(function(){
    ctrl=false;
    $(document).keydown(function(e){
        if(e.keyCode==17)ctrl=true;
        else if(e.keyCode==67&&ctrl){e.preventDefault();return false;}
    }).keyup(function(e){if(e.keyCode==17)ctrl=false;});
});
 Respond  
Callumlord   -  Feb 22, 2011

You can still CTRL + C :( but great script :))))) try and add the CTRL + C block :))))

 Respond  
BigSteve   -  Jan 27, 2011

doesnt stop you using CTRL + C though so you can still c&p

 Respond  
Hawkee   -  Jan 26, 2011

Ack, I would be very bothered if something like this stopped me from copying text. I usually copy strings to run them through Google, not to steal any information.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.