0

I don't know much about java script, but I'm trying to figure out how to do a function on my webpage were a user presses a key and set text will load to the windows clipboard, from what I have researched you have to do it with on of these zeroclip or zclip so that it will work in all browsers. the closest i could come up with is this...

<script type="text/javascript"> $(document).ready(function() {
$(window).keyup(function(e)
 {
  if(e.keyCode == 17)
   {
    // Load text here...
  }

}); }); </script>    
  • zeroClipboard requires Adobe Flash (so won't work in mobile or tablet browsers). If you're going to use that anyway, [their website](https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/instructions.md) has documentation. – jfriend00 Nov 08 '14 at 17:09
  • there website has documentation.. yes, to use it with a button on the webpage, not keyboard button press. – superlurker Nov 08 '14 at 18:56
  • Adobe flash ONLY accepts clipboard content via a direct click - NOT via keyboard. That's how zeroClipboard works within the security limitations of Adobe Flash. Putting content on the clipboard from a regular web page is considered insecure any other way. – jfriend00 Nov 08 '14 at 20:15
  • Is there anyway other way to do this? – superlurker Nov 08 '14 at 21:01
  • No. There is not. Browsers have blocked clipboard access for security reasons for a long time now. Further discussion here: http://stackoverflow.com/questions/400212/copy-to-the-clipboard-in-javascript – jfriend00 Nov 08 '14 at 22:27

0 Answers0