Re: [clipboard events] Spec update

> I'm eager to replace our flash clipboard bridge with this native api.

Uh, I'm glad you like it but I wouldn't hold my breath.. I hope implementors will like it too but I have no way to tell when implementations will actually be available.

> Would this be the correct code to write a string to the clipboard on a
> button click?

Almost, just create a "copy" event rather than a "paste" one ;-)

>  document.getElementById("copytoclipboard").addEventListener("click",
> function() {
>    var event = new ClipboardEvent('paste', {data: 'COPIED!',

This is where 'paste' ought to  be 'copy'. Then it should just work.

> dataType: 'text/plain'});
>    document.dispatchEvent(event);
>  });

-Hallvord

Received on Tuesday, 21 January 2014 02:59:59 UTC