How to prevent a window not to be clicked or selected any way in java script?

Showing Answers 1 - 3 of 3 Answers

<script language="javascript">
 function noClick(e) {
  if (navigator.appName == 'Netscape' && e.which == 3) {
      alert("no right click please")
      return false;
      }
   else {
      if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2)
         alert("no right click please")
         return false;
         }
   return true;
 }
document.onmousedown=noClick
</script>

Using the button code instead of '2' you can restrict the key press also

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions