This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
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: 15385
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