Disable right-click without alert?

Giganews Newsgroups
Subject: Disable right-click without alert?
Posted by:  McKirahan (Ne…@McKirahan.com)
Date: Tue, 24 Aug 2004

Without using

    <body oncontextmenu="return false">

can right-click be disabled without an alert()?

Perhaps with a variation of the following:

<html>
<head>
<title>noclick.htm</title>
<script type="text/javascript">
function click() {
  if (event.button == 2) alert("right-click disabled.");
}
document.onmousedown = click;
</script>
</head>
<body>
</body>
</html>

Thanks in advance.

Replies