Click here to Skip to main content
12,446,146 members (39,568 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

18.7K views
5 bookmarked
Posted

Disable right click context menu cut, copy, paste

, 5 Aug 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
DescriptionD...

Description

Disable Right Click using jQuery

Code

<html>
<head>
<title>Disable Right Click using jQuery</title>
<script type="text/javascript" src="jquery-1.6.2.js"></script>
<script type="text/javascript">
$(function() {
     $(this).bind("contextmenu", function(e) {
         e.preventDefault();
     });
}); 
</script>
</head>
<body>
Disable Right Click using jQuery
</body>
</html>

Browser Compatibility

I have tested this script in the following Web browsers:
  • Internet Explorer
  • Mozilla Firefox
  • Google Chrome
  • Safari
  • Opera

jQuery

Download Latest jQuery - http://jquery.com/[^]
jQuery Tutorial - http://www.w3schools.com/jquery/default.asp[^]

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

thatraja
Web Developer
India India
Retired from Q/A section & Technical forums since 2014

More coming soon....

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralMy vote of 3 Pin
sahabiswarup8-May-13 21:21
membersahabiswarup8-May-13 21:21 
GeneralMy vote of 3 Pin
Michael Schauffler3-May-12 8:40
memberMichael Schauffler3-May-12 8:40 
AnswerRe: My vote of 3 Pin
thatraja3-May-12 19:24
mvpthatraja3-May-12 19:24 
GeneralReason for my vote of 1 Besides my comments on the original,... Pin
LFD-Mike25-Nov-11 9:14
memberLFD-Mike25-Nov-11 9:14 
GeneralRe: Frankly thats not a fair reason to downvote. Here I just pos... Pin
thatraja25-Nov-11 16:43
mvpthatraja25-Nov-11 16:43 
GeneralIf we Disable Javascript means..Any other possible way to do... Pin
Prince Antony G24-Nov-11 19:58
memberPrince Antony G24-Nov-11 19:58 
GeneralSorry i early mentioned its not working... Becz i didnt Sele... Pin
Prince Antony G24-Nov-11 19:36
memberPrince Antony G24-Nov-11 19:36 
GeneralRe: For me its working. which FF version? Its working in FF6 or ... Pin
thatraja24-Nov-11 19:45
mvpthatraja24-Nov-11 19:45 
GeneralRe: Sorry i early mentioned its not working... Becz i didnt Sele... Pin
Michael Schauffler3-May-12 8:31
memberMichael Schauffler3-May-12 8:31 
GeneralIts not working in Mozilla Firefox Pin
Prince Antony G24-Nov-11 19:36
memberPrince Antony G24-Nov-11 19:36 
GeneralRe: Its not working in Mozilla Firefox Pin
Michael Schauffler3-May-12 8:29
memberMichael Schauffler3-May-12 8:29 
Generalworking fine with this script to .. must comment super duper... Pin
dineshkummarc17-Nov-11 23:53
memberdineshkummarc17-Nov-11 23:53 
GeneralReason for my vote of 5 thats how i would do it too :D Pin
GottZ8-Aug-11 21:04
memberGottZ8-Aug-11 21:04 
GeneralReason for my vote of 5 Nice tip! Pin
mbcrump5-Aug-11 10:40
mentormbcrump5-Aug-11 10:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160811.3 | Last Updated 5 Aug 2011
Article Copyright 2011 by thatraja
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid