Disable right clicking & image download in a web page

by Geethalakshmi 2009-05-25 10:15:08


Script to Disable right clicking & image download in a web page

Add this HTML to your website:

<script language=JavaScript>
<!--

//Disable right mouse click Script

var message="Function 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>


You can replace: Function Disabled!
Hope this helps!

Tagged in:

1145
like
0
dislike
0
mail
flag

You must LOGIN to add comments