javascript 将文本复制到剪贴板 html5 和 Jquery

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19135675/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 14:30:46  来源:igfitidea点击:

javascript copy text to clipboard html5 and Jquery

javascriptjqueryhtml

提问by werva

I searched this question and there are so many ways that I cannot select from them.

我搜索了这个问题,有很多方法我无法从中选择。

Some of them are not supported any more. some are complicated.

其中一些不再受支持。有些很复杂。

I am looking for the simplest one for browsers supporting HTML5. I don't care if it is supported by old IE or not.

我正在寻找最简单的支持 HTML5 的浏览器。我不在乎旧 IE 是否支持它。

I prefer native javascript or Jquery. But plugins are fine too.

我更喜欢原生 javascript 或 Jquery。但是插件也很好。

回答by gwillie

javascript cant do it, security issue for accessing client clipboard, but flash can, and every browser we care about has flash, but flash (thank god) is on the way out, so for now everyone is in flux. flash for now is the only option, but will the powers that be be able to look pass the potential security issues...well wait and see. that's all i know!

JavaScript的不能做,安全问题访问客户端剪贴板中,但Flash可以,和每一个我们关心的浏览器大约有闪光灯,但闪光灯(感谢上帝)是出路,所以现在大家都在不断变化。Flash 目前是唯一的选择,但是能够通过潜在安全问题的权力是否会...等等等等。这是我所知道的一切!