|
|
|
ผมอยากได้ Code ที่สามารถป้องกันการ Copy Content , การคลิกขวา ของตัวหน้าเวป ผมอ่ะครับ รบกวนหนอ่ยน่ะครับ |
|
|
|
|
|
|
|
ใช้ Ajax ครับ โหลด Content วิธ๊นี้จะไม่สามารถ View Source ได้ เพิ่ม Option ป้องกันการคลิกขวา แต่จะไม่ 100% แต่ข้อเสียคือ Bot อ่านไม่ออก หรืออาจจะอ่านไม่ได้
|
|
|
|
|
Date :
2014-12-18 13:28:02 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (JavaScript)
<script type='text/javascript'>
/***********************************************
* Disable Text Selection script- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
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';
}
/* Disable Right Click */
var message="You may not right mouse click this page.";
if (navigator.appName == 'Microsoft Internet Explorer'){
function NOclickIE(e) {
if (event.button == 2 || event.button == 3) {
//alert(message);
return false;
}
return true;
}
document.onmousedown=NOclickIE;
document.onmouseup=NOclickIE;
window.onmousedown=NOclickIE;
window.onmouseup=NOclickIE;
}
else {
function NOclickNN(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=NOclickNN; }
document.oncontextmenu=new Function("return false")
}
function disableCtrlKeyCombination(e){
//list all CTRL + key combinations you want to disable
var forbiddenKeys = new Array('a', 'c', 's', 'u', 'x');
var key;
var isCtrl;
if(window.event){
key = window.event.keyCode; //IE
if(window.event.ctrlKey) isCtrl = true;
else isCtrl = false;
}
else{
key = e.which; //firefox
if(e.ctrlKey) isCtrl = true;
else isCtrl = false;
}
//if ctrl is pressed check if other key is in forbidenKeys array
if(isCtrl){
for(i=0; i<forbiddenKeys .length; i++){
//case-insensitive comparation
if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase()){
//alert('Key combination CTRL + '+String.fromCharCode(key)+' has been disabled.');
return false;
}
}
}
return true;
}</script>
<script type="text/javascript" src="/a/script/textsizer.js">
/***********************************************
* Document Text Sizer- Copyright 2003 - Taewook Kang. All rights reserved.
* Coded by: Taewook Kang (http://www.txkang.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<script language=JavaScript>
<!--
var message="ใส่ข้อความเตือนเมื่อมีการ Copy";
function clickIE4(){
if (event.button==2){
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
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("return false")
// -->
</script>
<script language="JavaScript1.2">
//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
}
</script>
ได้ล่ะจ๊ะ
|
|
|
|
|
Date :
2014-12-18 14:28:58 |
By :
nut_ch31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2014-12-18 15:02:38 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|