Copying to the clipboard is a tricky task to do in Javascript in terms of browser compatibility.
(就浏览器兼容性而言,复制到剪贴板是用Javascript要做的一项棘手任务。)
The best way to do it is using a small flash.(最好的方法是使用小型闪光灯。)
It will work on every browser.(它将在所有浏览器上运行。)
You can check it in this article .(您可以在本文中进行检查。)
Here's how to do it for Internet Explorer:
(这是针对Internet Explorer的操作方法:)
function copy (str)
{
//for IE ONLY!
window.clipboardData.setData('Text',str);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…