Disable Right Click On Your Blog

July 19, 2010

in Computeraholic

I was asked through email a while back how to disable right click in a blog or site to protect uploaded pictures. I found a code at DynamicDrive.com by Renigade, which does just that. It’s easy peasy to implement. Just copy and paste the following code immediately below the code of your template.

<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
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>

Please note that content in your site or blog can still be copied, even with the code, through highlighting the text and hitting CTRL+C in one’s keyboard. While this code against right clicking will not stop a determined and knowledgeable plagiarist, it does discourage the casual copier. Best thing to do is to watermark your images with your site or blog logo/URL, so that people know where they came from.



{ 4 comments… read them below or add one }

Anne July 19, 2010 at 10:59 pm

idol na kita talaga… ;-)

Reply

pehpot July 20, 2010 at 1:16 am

hindi na kita bibigyan ng opps hmp

papahirapan mo pa ako na i check ang links kung tama o mali hmp

hmp
hmmp

hmmmmpppppppppppp

Reply

zoan August 18, 2010 at 11:22 pm

infairness, masubukan nga ito :D ehehehe

Reply

Pink MagaLine February 24, 2011 at 8:36 pm

So cute layout you have here sis. I need to disable right click soon. Thanks for the tip.

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: