JS右键复制添加来源网址的代码

该日志由 samool 发表于 2008-05-22 8:58 AM

<script type="text/javascript">
document.body.oncopy = function () {
    setTimeout( function () {
        var text = clipboardData.getData("text");
        if (text) {
            text = text + "\r\n文章来源于《傻猫网络日志》 "+this.location.href;
clipboardData.setData("text", text);
        }
                }, 100 )
}
</script>

该日志标签: 右键, 复制, js, 来源, 网址