I'm familiar with ZeroClipboard and jquery.copy, which both use Flash. OK, so I get it, for browser security reasons, copying is disallowed and we need Flash. But this means the copying functionality does not work in mobiles (iPhone, Android) or iPad.
Is there any resource or plugin that allows a simple Copy to Clipboard functionality on both modern browsers (include IE7+) and mobile browsers?
Thanks!
Android can cut, copy and paste text, and like a computer, the operating system transfers the data to the clipboard. Unless you use an app or extension like Clipper or aNdClip to retain your clipboard history, however, once you copy new data to the clipboard, the old information is lost.
To cut and paste on Android, tap and hold a word until highlighted, then drag the handles to highlight the desired text and tap Cut. In another app, tap and hold, then tap Paste.
Cross-device copy and paste requires the exchange of data between your PC and Android device. If you've allowed your devices to sync over mobile data, and you're not connected to a Wi-Fi network, then copy and paste will use data.
Select and copy text from an app on your Android device. In Windows, open an application in which you can enter text. Press the Windows key and the V key to display the cloud clipboard. You should see the text you copied from Android.
There is not a great solution to do this without using flash. I would just keep it simple and allow your users to copy the text themselves. It's how google serves their analytics code to users to embed on their sites. I'm sure if there was a great way to do it that google would be using it.
Keeping it simple:
$(function(){
$('.text').click(function(){
$(this).select();
});
});
Focus event: http://jsfiddle.net/khXjC/
Click event: http://jsfiddle.net/qjfgoeLm/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With