0

I have been trying to integrate zero clipboard library with gwt code as follows.

test.html

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

     function initZeroClipboard() {
                   ZeroClipboard.setMoviePath('ZeroClipboard.swf');
       }

</script>

 .....................................
  //Intial body load instantiating 'Moviepath'

  <body onload="initZeroClipboard();">  

TestWidget.java

Anchor copy = new Anchor("Copy");
......................
 //setting id to refer the movie
copy.getElement().setId("copyId");
glueCopy("Hello World");
 ...........
 //Native method
public static native void glueCopy(String text) /*-{
 var clip = new $wnd.ZeroClipboard.Client();
 clip.setText(text);
 clip.glue('copyId');
}-*/;

But on intial load itself i am getting the following error in IE and FF.

Jetty Server IE error enter image description here

Jetty server FF error enter image description here

I have donloaded 'ZeroClipboard.swf' and 'ZeroClipboard.js' files from the following https://github.com/jonrohan/ZeroClipboard

Can anyone come across this issue, if so suggest me how to get rid of this.

enrybo
  • 1,787
  • 1
  • 12
  • 20
Jagadeesh
  • 2,730
  • 6
  • 30
  • 45

0 Answers0