No copy paste.

Platform:  Javascript
Published  Jan 26, 2011
Updated  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:

Code

 

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 <head></head>?? can u type here step by step. thnx :D
 Respond  
Wader   -  Aug 03, 2011
Stop you need to paste it into the <head></head> 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)

Code

 
 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.