|
网站防复制粘贴时自动带上版权和源地址
copyright.js文件的代码如下:
document.body.oncopy = function () {
setTimeout( function () {
var text = clipboardData.getData("text");
if (text) {
text = text + "\r\n本文来自: 你的网站名称 详细出处参考:"+location.href; clipboardData.setData("text", text);
}
}, 100 )
}
|