GoCubbies Posted May 29, 2015 Report Share Posted May 29, 2015 Hello All, Does anyone have any tricks or scripts to prevent copy/paste and right click on a DataPage. I understand that most scripts may be browser dependent, but just looking to make it a bit more difficult for users to copy things. Thanks in advance Quote Link to comment Share on other sites More sharing options...
MayMusic Posted May 29, 2015 Report Share Posted May 29, 2015 Try to see if this code works for you: <script type="text/JavaScript"> var message="NoRightClicking"; function noCopy(e){ return false } function reEnable(){ return true } document.onselectstart=new Function ("return false") if (window.sidebar){ document.onmousedown=noCopy document.onclick=reEnable } function defeatIE() {if (document.all) {(message);return false;}} function defeatNS(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=defeatNS;} else{document.onmouseup=defeatNS;document.oncontextmenu=defeatIE;} document.oncontextmenu=new Function("return false") </script> Quote Link to comment Share on other sites More sharing options...
GoCubbies Posted May 29, 2015 Author Report Share Posted May 29, 2015 Thank you, I placed this in my DataPage header an it worked like a charm. Thanks again. As a note, it seemed to work if I placed in my actual web page header as well. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.