function document.onmousedown(){
  if(event.button==2){alert("你点了右键");}
}

解决方案 »

  1.   

    我是在图片上点的右键!如果用了
    <input type="image" name="map" src="E;//aa.jpg" oncontextmenu="return false">
    该怎么办?
      

  2.   

    <input type="image" name="map" src="http://www.csdn.net/images/csdn.gif"
     oncontextmenu="return false"><script language=javascript>
    function document.onmousedown()
    {
      if(event.button==2)alert("你点了右键");
    }
    </script>
      

  3.   

    <input type="image" name="map" src="E:/aa.jpg" onmousedown="if(event.button==2){return false;}">