- Xu
- 769,905,395
Bài viết: 4165 



Các bạn thêm đoạn mã sau vào trong thẻ head của trang web
Cách 1: Copy đầy đủ & Tự ghi nguồn
Demo: Bạn thử copy ở 1 vị trí bất kỳ tại dembuon.vn và paste thử.
Cách 2: Copy sẽ ghi nguồn & Chỉ lấy được phần text
Cách 1: Copy đầy đủ & Tự ghi nguồn
HTML:
<!-- / C.N.G - V.N.O -->
<script type="text/javascript">
if(document.location.protocol=='http:'){
var Tynt=Tynt||[];
Tynt.push('ce4Ugik24r46FUacwqm_6r');
(function(){
var s=document.createElement('script');
s.async="async";s.type="text/javascript";
s.src='http://tcr.tynt.com/ti.js';
var h=document.getElementsByTagName('script')[0];
h.parentNode.insertBefore(s,h);})();
}
</script>
<!-- C.N.G - V.N.O / -->
Demo: Bạn thử copy ở 1 vị trí bất kỳ tại dembuon.vn và paste thử.
Cách 2: Copy sẽ ghi nguồn & Chỉ lấy được phần text
HTML:
<script type="text/javascript">
function addLink() {
//Get the selected text and append the extra info
var body_element = document.getElementsByTagName('body')[0];
var selection;
selection = window.getSelection();
var pagelink = "<br /><br /> Nguồn bài viết: <a href='"+document.location.href+"'>"+document.location.href+"</a>";
var copytext = selection + pagelink;
var newdiv = document.createElement('div');
//hide the newly created container
newdiv.style.position='absolute';
newdiv.style.left='-99999px';
//insert the container, fill it with the extended text, and define the new selection
body_element.appendChild(newdiv);
newdiv.innerHTML = copytext;
selection.selectAllChildren(newdiv);
window.setTimeout(function() {
body_element.removeChild(newdiv);
},0);
}
document.oncopy = addLink;
</script>
Chỉnh sửa cuối: