View Single Post
  #2 (permalink)  
Old 09-25-2007, 02:35 AM
muthu muthu is offline
D-Web Trainee
 
Join Date: Sep 2007
Posts: 5
muthu is on a distinguished road
Default Re: How can we block "Right click-refresh" option on a web-page?

hi

<script type="text/javascript">
var message="Function Disabled!";
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!docume nt.all){
if (e.which==2||e.which==3){
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("return false;")
</script>
Reply With Quote