How to copy text to the clipboard in Javascript?

I'm wondering if there's any way to copy text to the clipboard. I'm well aware of this answer, but it's over three years old now. Has anything changed since then?


The easiest thing to do at this point is to go with a Flash based solution. zeroclipboard is a common one (a nice walkthrough is available here).

Browser vendors have over the past few years removed programatic access to the clipboard. Safari / Chrome lost the ability after a change in WebKit, and FireFox for a long time has blocked it. Only IE remains as one that does allow it, however it displays an alert on each page initially.

链接地址: http://www.djcxy.com/p/10584.html

上一篇: 在Core Graphics中倒角路径/形状

下一篇: 如何将文本复制到JavaScript中的剪贴板?