Re: [clipops][editing] document.execCommand('copy', false, 'some data') ?

On Sat, Apr 11, 2015 at 8:16 PM, Aryeh Gregor <ayg@aryeh.name> wrote:

> > element.onclick = function(){
> >     document.execCommand('copy', false, 'foo');
> > }
>
> Is this really "copying"?


As in "an operation that places some data on the system clipboard", yes ;)
but I see your point of view.


> I think a new function for "set clipboard
> contents to specified value" would make more sense than overloading
> execCommand("copy") to mean something more than the standard
> text-editor meaning of "copy".  Besides, execCommand() is awful and we
> should prefer other APIs when possible.
>

So.. are you suggesting something like

window.Clipboard.setData('text/plain', 'foo') ?
-Hallvord

Received on Monday, 13 April 2015 12:19:25 UTC