Clipboard management with websites

不问归期 提交于 2020-01-11 13:11:51

问题


I would like to know how to put text into the clipboard like some popular websites are able to do. I have seen sites like www.photobucket.com and www.hulu.com somehow make copying to the clipboard automatic and cross browser. How can I do the same?

I saw a cross browser way to do it using flash, but it won't work with the current version?


回答1:


Take a look at this: http://ajaxian.com/archives/seeding-the-clipboard-in-flash10-with-zero-clipboard




回答2:


One option is Clippy, "a very simple Flash widget that makes it possible to place arbitrary text onto the client's clipboard.




回答3:


Well, since Firefox disables working with the clipboard in JS for security reasons, and you want cross browser support, it's not possible to get exactly what you want.

But really, sites like Photobucket don't do what you want and instead actually just select the entire textbox for you when you click it.

And a quick Google will help for finding how... here's one thing I found using the search terms javascript automatically select textbox...

http://www.dynamicdrive.com/forums/archive/index.php/t-17992.html



来源:https://stackoverflow.com/questions/6486426/how-can-i-copy-a-message-to-clipboard-in-html

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