سؤال

I read this question. I need to do a clipboard system in my gwt web application.

ZeroClipboard there is no longer on GoogleCode, and i have downloaded it from GitHub, but this guide doesn't work. Any one can help me?

This is my situation:

Home.html (in the same directory i have ZeroClipboard.js and ZeroClipboard.swf)

<script type="text/javascript" src="ZeroClipboard.js"></script>

MyPage.java

   -
   -
   -
    final Anchor copy = new Anchor("Copy");
    copy.getElement().setId("copyId");
    glueCopy("Hello World");
    add(copy);

  }

 public static native void glueCopy(String text) /*-{
  var clip = new $wnd.ZeroClipboard.Client();
  clip.setText(text);
  clip.glue('copyId');
}-*/;

Nothing happen when i click the anchor.

هل كانت مفيدة؟

المحلول

i have resolved the problem my self. Flash security policy doesn't permit the execute from localhost.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top