Total Pageviews

2/01/2010

Disable Right Click for your website using JavaScript on Internet Explorer.

Hello,

If you want to prevent your user from performing right click on your web site in Internet Explorer then you can try this basic trick to do it. Although its not 100% accurate but still it works and can be done easily where its not that much important to really disable it.
Just Add "oncontextmenu="return false""  to you body tage in HTML 

<BODY oncontextmenu="return false">


When any user perform right click on the web page the menu is requested, the oncontextmenu event runs, and we instantly cancel it using JavaScript. this way you can prevent your user to view some precious code and even prevent your user to open web page in multiple windows to.

cheers

3 comments:

Anonymous said...

Nice post dear, it works fine in all IE, Mozilla Firefox and Google Chrome. Thanks dear

Kailash said...

Nice post dear, it works fine in all IE, Mozilla Firefox and Google Chrome. I checked it dear, thanks

Venkatesh said...

It works. Thanks dude...

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews