CODE:
<script type="text/javascript">
document.body.oncopy = function () {
setTimeout( function () {
var text = clipboardData.getData("text");
if (text) {
text = text + "\r\n 【温馨提示】本文转载自: "+location.href; clipboardData.setData("text", text);
}
}, 100 )
}
</script>测试结果: Maxthon下不弹出提示,IE7和IE6下会弹出提示。Firefox下无效。方法二、
CODE:
<script type="text/javascript">
document.body.oncopy = function() {
event.returnValue = false;
var t = document.selection.createRange().text;
var s = "【温馨提示】本文转载自: "+top.window.location.href;
clipboardData.setData('Text',t+'\r\n'+s+'\r\n\r\n\r\n');
}
</script>测试结果: Maxthon和IE7下不弹出提示,IE6下会弹出提示。Firefox下无效。