jQuery: Prevent Right-Click on Website
Tip by Sledge | 2012-07-22 at 22:41
Sometimes we want to prevent the user from right clicking on our website. With this small piece of code and the help of jQuery, you can simply avoid that the context menu opens when the user right clicks on the page:
$(document).ready(function() { $(document).bind("contextmenu", function() { return false; }); });
Of course, also this code cannot prevent effectively, that someone can save the images or something else from our website. First of all, it only works with activated JavaScript and secondly, there are other possibilities to save images then to use a right click. But users who are unaware of what they are doing, can be certainly deterred.
About the Author
The author has not added a profile short description yet.
Show Profile
Related Topics
jQuery: Send HTML5 Canvas to Server via Ajax
Tutorial | 0 Comments
VirtualBox: Change Date and Time
Tutorial | 10 Comments
HTML5 Canvas: Beginner Tutorial Chapter 3 - Rectangles and Circles
Tutorial | 0 Comments
HTML5 Canvas: Beginner Tutorial Chapter 2 - Drawing Lines
Tutorial | 0 Comments
Send HTML5 Canvas as Image to Server
Tutorial | 0 Comments
jQuery: CSS Stylesheet Switcher
Tutorial | 1 Comment
XAMPP: How to set up SSL/HTTPS for local Projects
Tutorial | 4 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.