How to Disable using Mouse Right Click Events

    In this  Web Developing Language we can set particular Rights for the Users. To Disable Mouse Right Click Event In the Systems.For use Below JavaScript Code Inside the <head> Tag.In this code to use PHP, Asp.net,Html and other web Languages.




In this Picture will shown press the Browser Right  Click  Button is Disable.



<head>
<script type="text/javascript">
 
    var message = "Function Disabled......";
 
    function IE4() {
        if (event.button == 2) {
            alert(message);
            return false;
        }
    }
 
    function NS4(e) {
        if (document.layers || document.getElementById && !document.all) {
            if (e.which == 2 || e.which == 3) {
                alert(message);
                return false;
            }
        }
    }
 
    if (document.layers) {
        document.captureEvents(Event.MOUSEDOWN);
        document.onmousedown = NS4;
    }
    else if (document.all && !document.getElementById) {
        document.onmousedown = IE4;
    }
 
    document.oncontextmenu = new Function("alert(message);return false")
 
</script>
</head>

Comments

Popular posts from this blog

Insecure cookie setting: missing Secure flag

Maximum Stored Procedure Function Trigger or View Nesting Level Exceeded (limit 32) in SQL Server

Display Line Chart Using Chart.js MVC C#