javascript可以轻松操作客户端剪贴板内容
<input type="button" value="复制代码" onClick='javascript:if(setClipboard(document.getElementById("PageBreak").innerHTML)){alert("已复制到剪切板,请在文章内容分页处粘贴")};' />
<br><br>
</body>
</html><script>
document.body.onmousedown=function(){this.setCapture(false)}
document.body.onmouseup=function(){this.releaseCapture()}
document.onmousemove=function(){aa.innerHTML+=1}
</script>
</body>
</html>
ff:
<html>
<body>
<div id="aa" onmouseover="alert(1)"> </div>
<script>
document.onmousemove=function(){aa.innerHTML+=1}
</script>
</body>
</html> ie: document.selection.empty() ff: window.getSelection().removeAllRanges()
为了防止在拖放过程中选择内容,所以把它放到Move程序中,下面是兼容的写法:
window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
?