<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>复制页面文字时,增加“附加信息www.cnblogs.com/zhengxiqiang</title>

</head>

<body>
将这段文字复制后,在其他地方粘贴你就能看到自动加入的文字
<script type="text/javascript">
document.body.oncopy = function () {
 setTimeout( function () {
   var text = clipboardData.getData("text");
   if (text) {
    text = text + "本文来自-- www.cnblogs.com/zhengxiqiang";
    clipboardData.setData("text", text);
   }
 }, 100 )
}
</script>
</body>
</html>

相关文章:

  • 2021-12-08
  • 2022-12-23
  • 2022-01-11
  • 2021-12-30
  • 2021-06-09
  • 2021-11-20
  • 2022-12-23
  • 2022-02-16
猜你喜欢
  • 2021-09-20
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案