Bilindigi üzere , bir web sayfasini korumanin imkani ihtimali yoktur yani siz ne yapsaniz oradaki bilgiyi calacak adam calar , lakin isini zorlastirayim diyorsaniz , mesela sayfalarinizda sağ tuş kullanimini
kapatabilirsiniz , sordum.com anasayfasinda da bu var , peki bunu nasil yapariz diyorsaniz cevabi aşağıda:
1. Asağidaki kodu < body > kodu arasinda kullanin:
<body oncontextmenu="return false">
veya En basit sağ tuş yasaği ( < body > tag ini aşağıdaki şekilde degistirin)
</body ondragstart="return false" onselectstart="return false" >
yada daha etkili birsey kullanmak istiyorsanız , < head > < /head > arasina:
<script type="text/javascript"> function disableSelection(target){ if (typeof target.onselectstart!="undefined") //IE route target.onselectstart=function(){return false} else if (typeof target.style.MozUserSelect!="undefined") //Firefox route target.style.MozUserSelect="none" else //All other route (ie: Opera) target.onmousedown=function(){return false} target.style.cursor = "default" } </script> <script type="text/javascript"> var messağe=""; function clickIE() {if (document.all) {(messağe);return false;}} function clickNS(e) { if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(messağe);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>
< /body> < /html > arasina (yani sona):
<script type="text/javascript"> disableSelection(document.body) //disable text selection on entire body of page </script>
Koda ilave velociraptor