Disabling right click on your webpage

Last update on August 22, 2009 02:03 PM by jak58
Published by deri58

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.
Best answers for « Disabling right click on your webpage » in :
Restrict Right click of mouse Show Restrict Right click of mouse On your website, for protection of source code and photos, it is possible to restrict visitor from right click on your web page. Place this script between the tags and of your HTML...
PROBLEM 'Save Image As' Show PROBLEM "Save Image As" Solution It may happen that when you right click on an image "Save image as" the internet explorer allow you to save images in BMP format and no other possible format! Solution The solution is to...
Disable / Enable the TouchPad ShowDisable / Enable the TouchPad On laptops, sometimes your TouchPad is disabled for no apparent reason. To reactivate it, first try restarting your PC. If there’s no good change just try: We need the software driver and your mouse are...
Disable Search Service ShowDisable Search Service Go in Control Panel /Administrative Tools/Click on Services. In Services, right click on the service : Windows Search , then click on properties In the General Tab, in Startup Type choose...
Disabling/Enabling System Restore in Vista ShowDisabling/Enabling System Restore in Vista After disinfection, it is recommended to deactivate and then reactivate System Restore (to clean it) as sometimes the restore points can be infected. Click the Vista logo right-click "Computer"...
Download ScrapBook ShowInternet progresses permanently, and the pages disappear. ScrapBook allows to save copies or web page extracts, and allows to annotate them. It can also recover multiple pages (such as HTTrack) Are you interested in a page? A simple right- click...
Windows networking ShowNetworking in Windows 2000/XP To configure each computer, simply go to the control panel, then double-click "network connections" and right-click "local area connection", then choose properties! The local area connection window displays the...
Windows - Diagnostic tools ShowAccessing diagnostic tools On the Desktop, when you right-click on a drive and go to Properties, the "Tools" tab gives you access to three tools: Defragmenter (c:\windows\defrag.exe) Scandisk (c:\windows\command\scandisk.exe) Backup (c:\program...
The mouse ShowIntroduction to the mouse The mouse is a pointing device used to move a cursor on the screen and allowing objects to be selected, moved and manipulated using the buttons. The consistent action of pressing (clicking) on a button in order to carry...