No Right Click – Disable the right click on your pages to prevent users from “borrowing” images from your site and viewing your page source!
Ever wanted to prevent users from “borrowing” images from your site through right-clicking them and “save image as…” or right-clicking the page and viewing your page source? The No Right Click will disable the right click on your page in just a few clicks. No programming knowledge needed!
Protect the content of your Web page by preventing others from viewing your source code!
Simply add the following code to the <BODY> section of your web page (Press Ctrl C after selecting code to copy it):
<script language=JavaScript>
<!–
var message=”This website and it’s contents are owned and licensed by http://ranawd.wordpress.com.nAll contents are copyrighted and are not available for download and/or use on any other site.nnAll Rights Reserved. © 2007-2008 http://ranawd.wordpress.com”;
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function(“alert(message);return false”)
// –>
</script>
chris
I placed your script into my header.php file on my eiditor and saved the page and no luck. Still can right click and save the images. Can you shed any more light on the subject
thanks
-chris
Saidur Rahman
Hello Chris
I have checked my code again, it works fine. I have attached a HTML file in your email address, please run this and check. Finally if you keep this code right place i think it should be worked. This code IE6, IE7, Safari, Opera and Mozilla Firfox supported. Please check again. If you have any query please inform me. Thanks and Regards
Rana