2016-10-13 00:16:48 点击量:77 标签: 收藏本文
[js]js代码复制网页内容时自动加版权信息
- <script language="javascript">
- document.body.oncopy = function () {
- setTimeout( function () {
- var text = clipboardData.getData("text");
- if (text) {
- texttext = text + " \r\n酷播资料引用:"+location.href; clipboardData.setData("text", text);
- }
- }, 100 )
- }
- </script>