 <p>I did following code :</p> <pre><code>&lt;script src="${resource(dir: 'js', file: 'jquery.zclip.js')}"&gt;&lt;/script&gt; &lt;script src="${resource(dir: 'js', file: 'jquery.zclip.min.js')}"&gt;&lt;/script&gt; &lt;script&gt; function copyToClipboard(){ $("#copyLink").zclip({ path: "/js/ZeroClipboard.swf", copy: $("#genCampUrl").val(), afterCopy:function(){ alert('copied'); } }); } &lt;/script&gt; &lt;a id="copyLink" onclick="copyToClipboard();"&gt;Copy this url&lt;/a&gt; </code></pre> <p>On localhost it doesn't work. As the movie needs to be uploaded somewhere. But on server, it works. </p>