Zeroclipboard - client.on function does not call

I am implementing zeroclipboard on my website.

I added a button and javascript code as described on the GitHub page. The path is fine, the JavaScript console in Chrome does not show any errors.

But .on-function is never called. I press a button and nothing happens. I added console.log to my js file to see that it is "invoked".

Here is the HTML button:

<button id="copy-button" data-clipboard-text="Copy Me!" title="Click to copy me.">Copy to Clipboard</button>

And here is my JS:

var client = new ZeroClipboard( document.getElementById("copy-button"), {
  moviePath: "/assets/app/shared/swf/ZeroClipboard.swf"
} );

client.on( "load", function(client) {
  // alert( "movie is loaded" );

  client.on( "complete", function(client, args) {
    // `this` is the element that was clicked
    this.style.display = "none";
    alert("Copied text to clipboard: " + args.text );
  } );
} );

Someone had the same problems and solved?

EDIT: it seems the flash file is not loading ... enter image description here

+3
source share
1 answer

Press the right mouse button to see if the flash movie is loaded in the button area. Probably javascript is not finding your flash movie.

0
source

All Articles