Wednesday, January 19, 2011

Disabling right click on web page , Disabling right click on a particular div Disabling Text copy from a web page

Disabling right click on web page

Just paste the code in your Head tag

<script LANGUAGE="JavaScript">

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

</script>



Disabling right click on a particular div :


<script LANGUAGE="JavaScript">

document.getElementById('div1').oncontextmenu=new Function ("return false")

</script

Disable Text copy and right clicks:

SCRIPT LANGUAGE="JavaScript">

<!-- Disable

function disableselect(e){

return false

}

function reEnable(){

return true

}

//if IE4+

document.onselectstart=new Function ("return false")

document.oncontextmenu=new Function ("return false")

//if NS6

if (window.sidebar){

document.onmousedown=disableselect

document.onclick=reEnable

}

//-->

No comments:

Post a Comment