I got stucked in implementing this feature on my web application. All the other possibilities are mostly by using flash content. Could someone explain how I can achieve it by using plain javascript or by Dojo.
I have been working on the exact same issue for a while. For me flash isn't a viable solution so I came up with this simple work around:
<button onclick="prompt('Press Ctrl + C, then Enter to copy to clipboard','copy me')">Click to Copy</button>
It requires some extra work on the users end but at least it doesn't require flash or external libraries.
example fiddle
Wanted to implement the same feature. Ended up using https://clipboardjs.com.
new Clipboard('.btn', {
text: function() {
return window.location.href;
}
});
Works well
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