ZeroClipboard just isn't working

mythofechelon picture mythofechelon · Oct 26, 2012 · Viewed 12k times · Source

Originally, this post was regarding my attempts to inject ZeroClipboard into web pages by and for use by my Chrome extension, but I've dumbed the scenario down and down and down in a seemingly futile attempt to identify the issue and I still can't get it to work.

I'm even having difficulty getting the actual, documented "Minimal Example" on ZeroClipboard's own GitHub to work (admittedly, I've modded the source to actually be HTML5-valid, but the exact original didn't work either). Even test.html, which is included in the tar.gz archive, doesn't work!

"Minimal Example": Code

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
    </head>
    <body>
        <input type="button" id="d_clip_button" data-clipboard-text="Copy Me!" value="Copy To Clipboard" />
        <script src="ZeroClipboard.js"></script>
        <script>
            var clip = new ZeroClipboard( document.getElementById('d_clip_button') );
        </script>
    </body>
</html>

"Minimal Example": Console Output

Uncaught TypeError: object is not a function  index.html:11

Info

  • The entire contents of the zeroclipboard-1.0.7.tar.gz archive are in the same directory as index.html.
  • The ZeroClipboard.js file isn't corrupted / incomplete and is being loaded correctly.
  • I'm using Chrome v24.0.1312.52

 

Either I'm missing something really, really obvious here or ZeroClipboard's documentation / functionality is abysmal.

Answer

Uwe Keim picture Uwe Keim · Jan 24, 2013

What I've just found out:

That didn't match. I've got a similar error than the original poster of this question.

After I used the example from GitHub I've succeeded.

Conclusion:

Either use both the example and download from Google Code or (which I would prefer), both the example and download from GitHub.