RSS

Monthly Archives: July 2015

Disable right click and F12 in jQuery

$(document).ready(function(){
$("body").bind("contextmenu", function(e) {
    e.preventDefault();
});
document.onkeypress = function (event) {
        event = (event || window.event);
        if (event.keyCode == 123) {
            return false;
        }
    }
    document.onmousedown = function (event) {
        event = (event || window.event);
        if (event.keyCode == 123) {
            return false;
        }
    }
document.onkeydown = function (event) {
        event = (event || window.event);
        if (event.keyCode == 123) {
            return false;
        }
    }
});
 
Leave a comment

Posted by on July 16, 2015 in jQuery