Disable Right click on web page using JQuery
In this JQuery Tutorial we are going to protect our webpage by restricting right click event disabled. We can do this one using jquery very easily. Please find below image as output.See more JQuery Interview Questions.
Output:
Disable Right click using JQuery (On webpage) with an Example |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Disable right click on webpage.</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"> </script> <script type="text/javascript" language="javascript"> $(function () { $("*").bind("contextmenu", function () { alert("Sorry...Right Click is disabled"); return false; }); }); </script> </head> <body> http://aspnettutorialonline.blogspot.com </body> </html>
Post a Comment
Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.