js代码 复制网页内容时自动加版权信息
<script language="javascript">
document.body.oncopy = function () {
setTimeout( function () {
var text = clipboardData.getData("text");
if (text) {
text = text + " \r\n资料引用:"+location.href; clipboardData.setData("text", text);
}
}, 100 )
}
</script>
document.body.oncopy = function () {
setTimeout( function () {
var text = clipboardData.getData("text");
if (text) {
text = text + " \r\n资料引用:"+location.href; clipboardData.setData("text", text);
}
}, 100 )
}
</script>
代码复制到<body></body>之间。