复制到没有Flash的剪贴板 - Firefox,Chrome,Safari,Opera [英] Copy to clipboard with no Flash - Firefox, Chrome, Safari, Opera
问题描述
可能重复:
复制到没有Flash的剪贴板
我想复制一些从给定id到剪贴板的元素中的文本。我希望成为 flashless 解决方案,完全没有Flash。它可以是jQuery或JavaScript。
I want to copy some text from an element by a given id to clipboard. I want to be flashless solution, no Flash at all. It can be in jQuery or JavaScript.
IE的解决方案很简单(clipboardData),但对于FF,Chrome和其他 - 它不起作用。
The solution for IE is simple (clipboardData), but for FF, Chrome and others - it doesn't work.
帮助。
推荐答案
没有javascript方法可以做到这一点 - 它被阻止了通过浏览器安全... Flash是最好的选择...
There is no javascript method to do this - its prevented by browser security ... Flash is the best alternative ...
Firefox上安全策略的说明 - > http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard
Explanation of security policy on Firefox -> http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard
这篇关于复制到没有Flash的剪贴板 - Firefox,Chrome,Safari,Opera的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!