Sunday, April 29, 2012

DISABLE TEXT SELECTION AND RIGHT CLICKING ON WEBSITES



DISABLE TEXT SELECTION IN WEBSITES


PLACE THE BELOW CODE IN 
<head> 
....
</head> TAG


CODE


<SCRIPT TYPE="text/javascript"> 
<!-- 
//Disable select-text script (IE4+, NS6+)


/////////////////////////////////// 
function disableselect(e){
return false

function reEnable(){
return true

//if IE4+
document.onselectstart=new Function ("return false") 
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
// -->




DISABLE RIGHT CLICK WITHOUT MESSAGE



MAKE THE BODY TAG AS GIVEN BELOW




<body oncontextmenu="return false">

No comments:

Post a Comment