A most popular method for the prevention of the data on blog and Website is the Right Click Disable function. It is the easiest way to keep the novice and newbie thieves or hackers from looting your web or blog stuff. Right Click Disable not only stop the copying of the images and any other material but also prevents the user from viewing the actual source code behind the page.
The code given below only stop the viewer from using the right click of the mouse on the Website or blog. However, the viewer can use keyboard short cuts (Context Menu Key or Shift key + F10 key) to copy or view the data integrated on the web or blog page. The Context Menu can also be stopped by being accessed by the viewer by using this simple html code.
Code
<body oncontextmenu="return false;">Since this post is about Right Click Disable function therefore we will focus only on disabling the right click of the mouse on the website or blog.
For website just simply copy the code in between the <head> tags of the page, you want to disable the right click function on it. On the blog all you have to do is to add a new "html/Javascript" widget to your blog layout. To do so first go to your blog > Layout > Add a Gadget > select HTML/Javascript. copy the code given below and you are done.
When you try to right click on the blog or website a popup message will show stating that "Function Disabled Because of Copyright" this is so because it is the default message set in the code. If you want it to edit or change with your own just simply change the value of the message variable in the third line of the code.
Code
<script language="JavaScript"><!--
var message="Function Disabled Because Of CopyRight";
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>
In case of any queries feel free to ask.
Thank you so much! This helped a lot, I was so worried I wouldn’t be able to do this, but now I can and it worked. SO THANK YOU SOOO MUCH!!
ReplyDeletewebsite design
Very interesting blog. Alot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one. Just thought that I would post and let you know.click here
ReplyDelete
ReplyDeleteThanks for this information. it is helpfull and worthy
Laptop Repair Center offers quality service for your laptop at a reasonable cost. We offer doorstep support, 24*7 onsite support, repair all brand laptops, have an expert team for onsite support, and much more. for more contact us on 7291903784
laptop repair center in Delhi