KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Yes, this question has been asked again and again: how to copy and paste from and to the system clipboard with javascript? I have found only partial solutions and hacks so far. The reason that it has been asked so often in the past is that there still is no working solution. However, I saw that Google Docs actually has a working solution now for both keyboard events as well as buttons. So, it is possible, but how do they do it? Software Salad article, Accessing the System Clipboard with JavaScript – A Holy Grail? , gives a nice overview of the problem (but it's a few years old). In short: you can use keyboard events ctrl+x, ctrl+c, ctrl+v to either copy text from a hidden textarea with prepared data, or catch pasted text in a hidden field and then do something with it you can use some hack via Flash or maybe a Java Applet to copy something to the system clipboard without need for user approval. you can use a "real" solution with clipboardData.setData for IE and execCommand for other browsers, which depends on approval of the user. Any idea how Google has tackled the clipboard problem?
Tags (comma-separated)
Save Edits
Cancel