<SCRIPT language="JavaScript">
<!--
function highlightmetasearch() {
document.post.message.select(); document.post.message.focus();
}
function copymetasearch() {
highlightmetasearch();
textRange = document.post.message.createTextRange();
textRange.execCommand("RemoveFormat");
textRange.execCommand("Copy");
alert("This post has been copied to your clipboard.\nIf this post is lost when you submit it you can easily repost it.\nAlways use this feature before posting!");
}
// -->
</SCRIPT>
2 回答
使用javascript没有一个好的/经过良好测试的解决方案,大多数解决方案仅适用于IE
我使用Flash组件Clippy完成了一次复制到剪贴板的功能,它非常易于使用 . 您可以在Github上查看它的存储库,但它只能复制到剪贴板 .
管理剪贴板的另一个好的库,也是在Flash中,是ZeroClipboard
一个简单的谷歌会回复我这个代码...... :-)