Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Client Side Scripting
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 10-30-2009, 08:16 PM
  #1
webmast3r
Adept (Level 5)
 
webmast3r's Avatar
 
Join Date: Oct 2008
Location: Cincinnati, OH
Posts: 41
iTrader: (0)
webmast3r is an unknown quantity at this point
No Right Click JavaScript

Awhile ago, I came across a useful little script that disables the right click context menu of a web page. Its probably the most effective script I found, since most of the others disable the menu from the right-mouse click only. This script blocks all access to the context menu from right-click and keyboard shortcuts. It also manages to do this with a lot less code. Compatible with Safari, FF, and IE but does not run in Opera. Haven't tried GoogleChrome yet either.
Code:
oncontextmenu="return false;"
Simply insert this javascript into the "oncontextmenu" attribute of the body tag
__________________
Brandon M. Niehaus
Associate of Information Technology in Web Programming
University of Cincinnati: Raymond Walters College

XHTML/CSS/JavaScript/VB.NET
webmast3r is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-31-2009, 12:53 AM
  #2
prasanthmj
Fighter (Level 4)
 
Join Date: Aug 2009
Posts: 34
iTrader: (0)
prasanthmj is an unknown quantity at this point
But what is its use? The source can be seen anyways through the menu.

Web is an open place. Disabling right click menu can't do any help otherthan making the website less usable.
prasanthmj is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-31-2009, 03:24 AM
  #3
Pegasus
Extremely Flighty Admin
 
Pegasus's Avatar
 
Join Date: Nov 2001
Location: 35º South of Santa Claus
Posts: 21,471
iTrader: (0)
Pegasus is a name known to allPegasus is a name known to allPegasus is a name known to allPegasus is a name known to allPegasus is a name known to allPegasus is a name known to all
Here's a discussion about protecting your code/images from unscrupulous people:

http://www.htmlforums.com/html-xhtml...uff-81125.html
__________________


Decaf is the root of all evil...
HTMLForums Awards 2008
Pegasus is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 02:52 PM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.