Wednesday, September 23, 2009

Turn Off Right Click

right click
Sometimes, you may be want the html source of your blog not easy to see or may be we want to hide the properties. One of many ways to to it is by turn off or disable right click.
Below are the script that you can use to turn off the right click.
Just copy the code and paste it between <head> and </head> tag.
<script language="JavaScript">
var message="Sorry..! Right Click is NOT ALLOWED";
///////////////////////////////////
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>
Just try the code and drop your comment below.
Thanks...!

8 comments:

K. said...

where should i paste the code ?

Saung Web said...

Thanks for your info friend... n met lebaran ya..

Saung Web

Anuh said...

@K : Just drop the code before </head>

Festival Museum Nusantara said...

postingnya keren-keren

Anonymous said...

paste to notepad or what??

ARTHRITIS HIPERTROFI said...

info yang sangat bagus sekali

DEMAM TIFOID said...

keren gan infonya...

INFEKSI USUS HALUS said...

info yang sangat bermanfaat sekali...

Post a Comment

Please submit your comments below.
If you find an error on word verification, just click at the "word verification" to show the word verification box.
Thanks