Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to disable popup menu in IE using javascript?

 
harivarma mudunuru
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want pop-up menu not to be displayed, when right clicking in the browser window. Can any one help me?
 
mahadevan raja
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey,
u shud write a onmousedown event on the body tag,and check in the function whether the event.button==2(this is the numeric equivalent of the right click for a 2 button mouse),if u have any doubt then prompt the event.button in the function and find out the equivalent of the right click,then proceed further.any more doubts,contact me.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In IE5 and above just add the following to your BODY:
 
harivarma mudunuru
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bodie,
Thank u for the information. U are great. It's working fine.
Originally posted by Bodie Minster:
[B]In IE5 and above just add the following to your BODY:
[/B]

 
Reilly Morris
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks...
The oncontextmenu is genius! I wrote code which used the onClick method and prompted an alert, but this one is far more authoritative. That being added, how do I now restrict viewrs from my source code through the View >> Source menu? This one would be really nice to have.
Reilly
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic