JS代码如下:
<script>
function addLink() {
var selection = window.getSelection();
pagelink = "【迟博勋博客】原文链接: " + document.location.href;
copytext = selection + pagelink;
newp = document.createElement('p');
newp.style.position = 'absolute';
newp.style.left = '-99999px';
document.body.appendChild(newp);
newp.innerHTML = copytext;
selection.selectAllChildren(newp);
window.setTimeout(function () {
document.body.removeChild(newp);
}, 100);
}
document.oncopy = addLink;
</script>
将品牌词修改为自己的就可以了。
更多相关内容请访问迟博勋博客查看。