Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes Copy content to clipboard Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Copy content to clipboard" Watch "Copy content to clipboard" New topic

Copy content to clipboard

vineet kumar chaudhry
Ranch Hand

Joined: Apr 02, 2011
Posts: 45

Do we have javascript that copies the contents to clipboard and which is atleast compatible with common browser like IE,Firefox,Chrome,Safari

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
Modern day browsers have security settings preventing it from happening. That is why the copy function here on the code blocks does not work. Only way for a pure JavaScript solution is to work is the user changes security settings. Other way around it is using a little flash file that does it. Google for it.

vineet kumar chaudhry
Ranch Hand

Joined: Apr 02, 2011
Posts: 45
Are you refering to ZeroClipboard Library in flash10 ?

I agree. Here's the link:
subject: Copy content to clipboard
Similar Threads
How to listen to the clipboard?
How to get files copied to office clipboard?
for loop initialization clause
Capturing an image to system clipboard
How to Export to Ms-Word?