Question

I've read this https://github.com/zeroclipboard/ZeroClipboard

And it says "The ZeroClipboard JavaScript library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie."

But why? What purpose does it serve to copy the text using a Flash movie?

Thanks!

Était-ce utile?

La solution

You don't have cross-browser access to the clipboard in JavaScript on a web browser otherwise. So if you want to provide functionality that requires it (copying something to the clipboard for the user), until the clipboard spec gets decent support, this is the kind of hoop you have to jump through. One use case that comes to mind is the "copy to clipboard" button on the github page you linked (on the right, next to the clone URL).

The term "movie" is a bit misleading. It uses Flash, which has access to the clipboard and which is accessible from JavaScript. The "movie" aspect isn't important.

Autres conseils

Because Javascript does not have any native method to access the clipboard, due to sandbox restrictions in the browser.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top