Pages

Disable Right Click on Webpage

Disable Right Mouse Click Script Code:













Disable Right Click On Your Blog/Webpage.  Just Past Any 1 Code & Secure Your Blog.



Code 1: Copy & Past:

<script language="javascript" type="text/javascript">




var message="Due to security reason, Right Click is Not Allowed  www.Swapnil2Tech.tk";

    function clickIE4()

    {

        if (event.button==2)

        {

            alert(message);

            return false;

        }

    }

   

    function clickNS4(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=clickNS4;

    }

    else if (document.all&&!document.getElementById)

    {

        document.onmousedown=clickIE4;

    }

    document.oncontextmenu=new Function("alert(message);return false;")</script>



Code 2: Copy & Past:
Use this code in the head section of your page

try right clicking now to see the effect

<SCRIPT language=JavaScript>
<!-- http://www.spacegun.co.uk -->
    var message = "function disabled";
    function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){     alert(message); return false; }
    if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {     alert(message);     return false; } }
    document.onmousedown = rtclickcheck;
</SCRIPT>


Code 3: Copy& Past:

<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(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=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// -->
</script>


.

No comments:

Post a Comment