Disabling right click on your webpage
More than often, while trying so save some text or pictures from a website, you might wonder why your right click is not allowed. This is a simple JavaScript code that has been inserted in the website document to prevent copyright infringement issues, or to protect the source of your pictures. If you want to activate this option on your own website, here is a little tutorial on how you can do so, using JavaScript codes.
Note:
You should insert the following code in the head of your HTML document, that is, between the <HEAD></HEAD> tags.
<SCRIPT LANGUAGE="JavaScript">
<!-- Disable
function disableselect(e){
return false
}
function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function ("return false")
document.oncontextmenu=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
//-->
</script>
You should however note that this procedure is not idiot proof. There are several ways a user can still copy the contents on your website. If they decide to disable the JavaScript on their web browser, they will be able to access your contents, with or without the right click. Hence, I would strongly suggest you to edit the copyright close on your pictures as well as your contents.