我们是不是也有经常看到在复制他人WORDPRESS博客内容的时候会同时弹出来提示版权的提示,这个功能是如何实现的呢?在这篇文章中,麦子整理有需要这样功能的用途。
function copyNotice(){
var copyNoticeString = "复制成功,转载注明出处"
if(navigator.userAgent.indexOf("MSIE")>0) {
art.dialog.alert(copyNoticeString);
} else {
alert(copyNoticeString);
}
}
document.body.oncopy=function(){
copyNotice();
}
我们可以将代码添加到当前主题的 Functions.php 文件中。
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END