Disabling the right click unto your blog.

Status
Not open for further replies.

ellathuuur

New Member
3
2013
4
0
Paste these codes under <body> or <head> tag of your code:
Code:
<script language=JavaScript>
<!--
var message="Right Clicking Disabled!";
///////////////////////////////////
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>

If you want to become a silent right click look for these codes and delete it alert(message); then your done! :D
 
8 comments
I don't see a good use on disabling the right click, either to annoy the visitor and force them accidentally left-clicking on ad-filled site, or to have their contents in site not be grabbed by noobs. Either way, it's not really that useful. Contents would be stolen when wanted to, unless one would disable access to the site.
 
You can choose to disable text selection instead;

Code:
http://forums.hscripts.com/viewtopic.php?f=4&t=3293
http://solidlystated.com/scripting/proper-way-to-disable-text-selection-and-highlighting/
http://stackoverflow.com/questions/3779534/how-to-disable-text-selection-with-css-or-js

However, if you think its a good method to safeguard your content, think again. You can fetch/rip off any site with certain loopholes. :)
 
Status
Not open for further replies.
Back
Top