ป้องกันคนคลิกขวา ป้องกันคน select ข้อความ


หน้าแรก JavaScripts ป้องกันคนคลิกขวา ป้องกันคน select ข้อความ

ป้องกันคนคลิกขวา




  Code

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



ป้องกันคน select ข้อความ




  Code
<script type="text/javascript">
function disableselect(e){
if (window.sidebar){
var objName=e.target.nodeName;
if(objName!="INPUT" && objName!="TEXTAREA"){
return false
}
}else{
return false
}
}

function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>



ห้ามคลิ๊กขวาและแดรกเมาส์




  Code
<script language='javascript'> document.onselectstart=new Function('return false'); function ds(e){return false;} function ra(){return true;} document.onmousedown=ds; document.onclick=ra; document.oncontextmenu = function (){ return false}; </script><br /> <br /> <script language='JavaScript'> if (top.location != self.location) {top.location = self.location} </script>



ห้ามแดรกเมาส์




  Code
<script language='javascript'> document.onselectstart=new Function('return false'); function ds(e){return false;} function ra(){return true;} document.onmousedown=ds; document.onclick=ra; </script><br /> <br /> <script language='JavaScript'> if (top.location != self.location) {top.location = self.location} </script>




ขึ้นไปด้านบน