views:

60

answers:

3

One of my clients would like a No Copy Script on there website to prevent people copying the text off the page. Is there a cross browser way you can do this? I would probably just look at a JavaScript method. I know this can be turned off by people with a bit of knowhow but will do for most cases.

+1  A: 
<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>



<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>
+3  A: 

There are ton of resources on the Internet about this request. Mind that a determined user will always be able to copy the text from a webpage.

Anax
@Anax, google results can change,.. if theres one that's useful/you know works, construct an answer from it :)
Rob
I refuse to copy someone else's work when (1) the Internet is full of such scripts and (2) I do not support his client's decision (ie I 100% agree with what you have posted as comment on the original question).
Anax
@Anax, I said "construct an answer", not "copy someone else's work wholesale" =) And the reason I posted my note as a comment to the question was because it doesn't answer the OPs question. As an answer to a question, a link to google search results is a *very* poor answer.
Rob
I am aware of that fact and I respect your downvote and your advice. My answer was intended to be poor.
Anax
+2  A: 

Not an answer but this what I think about the subject:

If you want people not to copy content of your site then don't post it on the Internet. javascript will prevent the user from selection but the users will be annoyed. (e.g. I sometimes select text to make the reading easier, instead of copying it)

People will still get the text via the HTML source/DOM. People can retype the text or make a picture and use OCR.

PoweRoy