Friday, December 26, 2008

Disable Context Menu In Browser

There are a number of situations where we don't want the user interacting with our website to have right click the content and get context menu for options like save images, copy text and etc. To do this we have a simple javascript available as follows:

<script language="javascript" type="text/javascript">
  function disableRightClick(){return false;}
  document.oncontextmenu = disableRightClick;
</script>

No comments:

Post a Comment