Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZeroClipboard just isn't working

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.

like image 956
mythofechelon Avatar asked Nov 03 '22 13:11

mythofechelon


1 Answers

What I've just found out:

  • I've downloaded the ZIP with the JS/SWF from GitHub.
  • I've looked into the examples from Google Code.

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.

like image 61
Uwe Keim Avatar answered Nov 12 '22 21:11

Uwe Keim