set clipboard content in any browser

最后都变了- 提交于 2019-12-08 07:31:06

问题


I need to set my user's clipboard when they trigger an event on my webpage. I realize each browser has a different way to do this, so do you know of a library or code snippet that will achieve this cross-browser?


回答1:


This article might help you with that : Copy to Clipboard with Javascript on Mozilla firefox and IE

The basic idea is to :

  • use window.clipboardData for Internet Explorer
  • and use some flash component for Mozilla

Seems that this doesn't work with Flash 10, though, from some reports I've seen (never tried myself)


And/Or here is another solution (still using Flash -- but seems to be working with Flash 10, for this one) : Zero Clipboard



来源:https://stackoverflow.com/questions/2025954/set-clipboard-content-in-any-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!