Cách thực hiện:
1. vào bố cục
2. vào chỉnh sửa code HTML
3. chèn đoạn code bên dưới vào sau thẻ<head>hoặc trước thẻ</head>
<!-- code chống quét khối -->
<script language='JavaScript1.2'>
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>
<!-- code chống dùng chuột phải -->
<script language='JavaScript'>
var msg="Welcome to BlOg Chipkool";
function disableIE() {if (document.all) {alert(msg);return false;}
}
function disableNS(e) {
if (document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {alert(msg);return false;}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);document.onmousedown=disableNS;
} else {
document.onmouseup=disableNS;document.oncontextmenu=disableIE;
}
document.oncontextmenu=new Function("alert(msg);return false")
</script>
Cập nhật : chỉ cấm sao chép ở trang bài viết, hoặc không cho thủ thuật hiển chạy trên trang chủ.
- Chỉ cấm sao chép ở trang bài viết : thủ thuật này xem ra tiện lợi nhất, vì bạn chủ yếu chỉ cấm việc người xem copy nội dung cũng như hình ảnh của bài viết, vì thế ta áp dụng thủ thuật này chỉ ở trang bài viết, như thế sẽ không làm cho người đọc thấy bất tiện. Để thực hiện việc này, bạn chỉ cần thêm đoạn code màu sau vào {code ở bước 3} :
{CODE Ở BƯỚC 3}
</b:if>
<b:if cond='
data:blog.url != data:blog.homepageUrl
'>
{CODE Ở BƯỚC 3}
</b:if>
Theo Fandung.com