<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:series="http://unfoldingneurons.com/"
> <channel><title>Comments on: JavaScript Copy to&#160;Clipboard</title> <atom:link href="http://davidwalsh.name/clipboard/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/clipboard</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Tue, 22 May 2012 05:31:04 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: andy</title><link>http://davidwalsh.name/clipboard#comment-31790</link> <dc:creator>andy</dc:creator> <pubDate>Fri, 20 Apr 2012 11:09:06 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4001#comment-31790</guid> <description>Can&#039;t make it work with pre tags. Is that possible?</description> <content:encoded><![CDATA[<p>Can&#8217;t make it work with pre tags. Is that possible?</p> ]]></content:encoded> </item> <item><title>By: John Martin</title><link>http://davidwalsh.name/clipboard#comment-31648</link> <dc:creator>John Martin</dc:creator> <pubDate>Mon, 16 Apr 2012 12:15:42 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4001#comment-31648</guid> <description>Thank you for code. This will help me with clipboard.</description> <content:encoded><![CDATA[<p>Thank you for code. This will help me with clipboard.</p> ]]></content:encoded> </item> <item><title>By: ady</title><link>http://davidwalsh.name/clipboard#comment-31606</link> <dc:creator>ady</dc:creator> <pubDate>Fri, 13 Apr 2012 20:23:12 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4001#comment-31606</guid> <description>How to use it on blogger.com ?</description> <content:encoded><![CDATA[<p>How to use it on blogger.com ?</p> ]]></content:encoded> </item> <item><title>By: Ult</title><link>http://davidwalsh.name/clipboard#comment-31001</link> <dc:creator>Ult</dc:creator> <pubDate>Wed, 14 Mar 2012 07:21:16 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4001#comment-31001</guid> <description>Perfect!
I&#039;ve been trying to implement this for a while, but with the developer&#039;s site&#039;s download links I just couldn&#039;t get it to work (maybe the latest releases aren&#039;t supported by Flash 11?), anyway with your code, your ZeroClipboard swf + js files, your example source code and demo page&#039;s source code + the developer&#039;s intructions page, it was pretty easy to get it working the way I wanted!Also, it IS possible to reposition a clip which was glued to a div/span (as opposed to what the developer&#039;s intructions say). All you have to do is create a global javascript var (I&#039;ll call it &quot;c&quot;) at the start of your page code, then copy the object reference to this global var after you create the zeroclip client, like this:&lt;code&gt;var clip = new ZeroClipboard.Client();
c1 = clip;&lt;/code&gt;Then,  just call a function when the user resizes the browser window, simplest option would be putting the reposition function call in theThe function would look something like this:
&lt;code&gt;
function repos(){
c.destroy(); //global var &quot;c&quot; references clip instance, calls its destroy method
var clip = new ZeroClipboard.Client(); //creates new zeroclip client/object/instance
clip.addEventListener(&#039;mousedown&#039;,function() {
clip.setText(&quot;text string you want to copy to clipboard&quot;);
});
clip.glue(&quot;id of whatever you want to glue this zeroclip client to&quot;);
c = clip; //updates &quot;c&quot; to reference the newly created zeroclip client
}&lt;/code&gt;This way the flash client is always being referenced by a global var, and with the destroy+(re)create+glue again function being called everytime the user resizes his browser window, you can glue it to a  or  without any problem.I&#039;ve implemented this into an AJAX page, for dynamically generated pages you&#039;d just have to check if whatever control &quot;c&quot; references still exists before doing the destroy+recreate function, or just empty the variable after destroying it and check if it&#039;s empty before the destroy+recreate function etc., it&#039;s not complicated. Hope this helps. =]</description> <content:encoded><![CDATA[<p>Perfect!<br
/> I&#8217;ve been trying to implement this for a while, but with the developer&#8217;s site&#8217;s download links I just couldn&#8217;t get it to work (maybe the latest releases aren&#8217;t supported by Flash 11?), anyway with your code, your ZeroClipboard swf + js files, your example source code and demo page&#8217;s source code + the developer&#8217;s intructions page, it was pretty easy to get it working the way I wanted!</p><p>Also, it IS possible to reposition a clip which was glued to a div/span (as opposed to what the developer&#8217;s intructions say). All you have to do is create a global javascript var (I&#8217;ll call it &#8220;c&#8221;) at the start of your page code, then copy the object reference to this global var after you create the zeroclip client, like this:</p><p><code>var clip = new ZeroClipboard.Client();<br
/> c1 = clip;</code></p><p>Then,  just call a function when the user resizes the browser window, simplest option would be putting the reposition function call in the</p><p>The function would look something like this:<br
/> <code><br
/> function repos(){<br
/> c.destroy(); //global var "c" references clip instance, calls its destroy method<br
/> var clip = new ZeroClipboard.Client(); //creates new zeroclip client/object/instance<br
/> clip.addEventListener('mousedown',function() {<br
/> clip.setText("text string you want to copy to clipboard");<br
/> });<br
/> clip.glue("id of whatever you want to glue this zeroclip client to");<br
/> c = clip; //updates "c" to reference the newly created zeroclip client<br
/> }</p><p></code></p><p>This way the flash client is always being referenced by a global var, and with the destroy+(re)create+glue again function being called everytime the user resizes his browser window, you can glue it to a  or  without any problem.</p><p>I&#8217;ve implemented this into an AJAX page, for dynamically generated pages you&#8217;d just have to check if whatever control &#8220;c&#8221; references still exists before doing the destroy+recreate function, or just empty the variable after destroying it and check if it&#8217;s empty before the destroy+recreate function etc., it&#8217;s not complicated. Hope this helps. =]</p> ]]></content:encoded> </item> <item><title>By: Sumit</title><link>http://davidwalsh.name/clipboard#comment-28731</link> <dc:creator>Sumit</dc:creator> <pubDate>Mon, 30 Jan 2012 04:59:55 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4001#comment-28731</guid> <description>I tried to implement this code on a normal text box and a button, I was able to do that, but when I tried it on a label and button inside a asp.net modalpopup I was not able to do that. PLease tell how can I implement in modalpopup ?</description> <content:encoded><![CDATA[<p>I tried to implement this code on a normal text box and a button, I was able to do that, but when I tried it on a label and button inside a asp.net modalpopup I was not able to do that. PLease tell how can I implement in modalpopup ?</p> ]]></content:encoded> </item> <item><title>By: Forum informatique</title><link>http://davidwalsh.name/clipboard#comment-26150</link> <dc:creator>Forum informatique</dc:creator> <pubDate>Thu, 21 Jul 2011 01:07:56 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4001#comment-26150</guid> <description>demo have errors ?</description> <content:encoded><![CDATA[<p>demo have errors ?</p> ]]></content:encoded> </item> <item><title>By: Danny</title><link>http://davidwalsh.name/clipboard#comment-24528</link> <dc:creator>Danny</dc:creator> <pubDate>Wed, 29 Jun 2011 10:05:00 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4001#comment-24528</guid> <description>I cannot get this to work in anyway in my web app. The movie object is hidden somewhere under my website main navigation.
&lt;code&gt;element.style {
height: 0;
left: 0;
position: absolute;
top: 0;
width: 0;
z-index: 99;
}&lt;/code&gt;The DOM loads some clip client and some text but I have no idea how to fix this.
Clicking the button nothing happens.Any ideas?
Danny</description> <content:encoded><![CDATA[<p>I cannot get this to work in anyway in my web app. The movie object is hidden somewhere under my website main navigation.<br
/> <code>element.style {<br
/> height: 0;<br
/> left: 0;<br
/> position: absolute;<br
/> top: 0;<br
/> width: 0;<br
/> z-index: 99;<br
/> }</code></p><p>The DOM loads some clip client and some text but I have no idea how to fix this.<br
/> Clicking the button nothing happens.</p><p>Any ideas?<br
/> Danny</p> ]]></content:encoded> </item> <item><title>By: Vilmondes Eracton</title><link>http://davidwalsh.name/clipboard#comment-23379</link> <dc:creator>Vilmondes Eracton</dc:creator> <pubDate>Wed, 06 Apr 2011 18:17:32 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4001#comment-23379</guid> <description>It has helped me a lot! Great job!Thanks!</description> <content:encoded><![CDATA[<p>It has helped me a lot! Great job!</p><p>Thanks!</p> ]]></content:encoded> </item> <item><title>By: Ntmd8r</title><link>http://davidwalsh.name/clipboard#comment-23305</link> <dc:creator>Ntmd8r</dc:creator> <pubDate>Tue, 29 Mar 2011 18:54:12 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4001#comment-23305</guid> <description>This is a great start (for me).
However, I need to be able to copy an entire page to the clipboard,
so the user can email it to others.
Javascript has a &quot;Window.Print()&quot; method.Why can&#039;t we have a similar &quot;Window.Copy()&quot; method.????Or perhaps I should use a &quot;Save as...&quot; facility for the page,
and then have them email that saved file as an attachment.Any thoughts or suggestions ?</description> <content:encoded><![CDATA[<p>This is a great start (for me).<br
/> However, I need to be able to copy an entire page to the clipboard,<br
/> so the user can email it to others.<br
/> Javascript has a &#8220;Window.Print()&#8221; method.</p><p>Why can&#8217;t we have a similar &#8220;Window.Copy()&#8221; method.????</p><p>Or perhaps I should use a &#8220;Save as&#8230;&#8221; facility for the page,<br
/> and then have them email that saved file as an attachment.</p><p>Any thoughts or suggestions ?</p> ]]></content:encoded> </item> <item><title>By: Aline</title><link>http://davidwalsh.name/clipboard#comment-22661</link> <dc:creator>Aline</dc:creator> <pubDate>Wed, 09 Feb 2011 12:36:55 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4001#comment-22661</guid> <description>Thanks, perfect!</description> <content:encoded><![CDATA[<p>Thanks, perfect!</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 3/7 queries in 0.027 seconds using disk: basic
Object Caching 805/805 objects using disk: basic

Served from: davidwalsh.name @ 2012-05-22 02:36:18 -->
