粘贴JS

抄抄CSDN

<script type="text/javascript">
                        document.body.oncopy = function() {
                            if (window.clipboardData) {
                                setTimeout(function() {
                                    var text = clipboardData.getData("text");
                                    if (text && text.length > 300) {
                                        text = text + "/r/n/n本文来自CSDN博客,转载请标明出处:" + location.href;
                                        clipboardData.setData("text", text);
                                    }
                                }, 100);
                            }
                        }
     </script>

posted @ 2010-01-07 10:52  super_mario  阅读(86)  评论(0编辑  收藏  举报