吴伟贤のBlog

Feed Rss

js实现复制后自动加版权信息

11.07.2008, js, by .

<script type="text/javascript">
document.body.oncopy = function () {
setTimeout( function () {
var text = clipboardData.getData("text");
if (text) {
text = text + "\r\n\r\n来源:厦门风\r\n原文地址:"+location.href;
clipboardData.setData("text", text); } }, 100 ) }
</script>

评论已关闭。