<?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/"
		>
<channel>
	<title>Comments on: Working with Events, part 2</title>
	<atom:link href="http://www.learningjquery.com/2008/05/working-with-events-part-2/feed" rel="self" type="application/rss+xml" />
	<link>http://www.learningjquery.com/2008/05/working-with-events-part-2</link>
	<description>Tips, techniques, and tutorials for the jQuery JavaScript library</description>
	<lastBuildDate>Sat, 13 Mar 2010 02:48:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2008/05/working-with-events-part-2/comment-page-1#comment-79751</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Sun, 28 Feb 2010 01:34:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/05/working-with-events-part-2#comment-79751</guid>
		<description>Hi Dakota, 
.live() is completely different from .clone(true). The .live() method sets up an event handler that &quot;listens&quot; for some kind of action to take place (such as a click) at which point the handler is triggered. The .clone(true) method makes a copy of elements specified by whatever is in the jQuery set at the time ( for example, all divs, if you do $(&#039;div&#039;).clone(true) ). By passing in true, it also copies events and data that are associated with those elements. 

Hope that makes sense.</description>
		<content:encoded><![CDATA[<p>Hi Dakota,<br />
.live() is completely different from .clone(true). The .live() method sets up an event handler that &#8220;listens&#8221; for some kind of action to take place (such as a click) at which point the handler is triggered. The .clone(true) method makes a copy of elements specified by whatever is in the jQuery set at the time ( for example, all divs, if you do $(&#8216;div&#8217;).clone(true) ). By passing in true, it also copies events and data that are associated with those elements. </p>
<p>Hope that makes sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vishu</title>
		<link>http://www.learningjquery.com/2008/05/working-with-events-part-2/comment-page-1#comment-79750</link>
		<dc:creator>Vishu</dc:creator>
		<pubDate>Sat, 27 Feb 2010 11:36:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/05/working-with-events-part-2#comment-79750</guid>
		<description>I was actually trying to bind a click even to the link tag generated from a php file(via jquery ajax call) which itself was called by the click event of a button on the home page, so after the php generated content(the link) asynchronously, the click event bound to the link didn&#039;t work, but my prob was solved by merely calling my jquery script again in the called php..

...I doubt if I make any sense above :P</description>
		<content:encoded><![CDATA[<p>I was actually trying to bind a click even to the link tag generated from a php file(via jquery ajax call) which itself was called by the click event of a button on the home page, so after the php generated content(the link) asynchronously, the click event bound to the link didn&#8217;t work, but my prob was solved by merely calling my jquery script again in the called php..</p>
<p>&#8230;I doubt if I make any sense above :P</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dakota</title>
		<link>http://www.learningjquery.com/2008/05/working-with-events-part-2/comment-page-1#comment-79736</link>
		<dc:creator>Dakota</dc:creator>
		<pubDate>Tue, 23 Feb 2010 02:30:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/05/working-with-events-part-2#comment-79736</guid>
		<description>Hi Karl, Is the .live() method in 1.3ish just an alias for .clone(true), or does it do other stuff as well?</description>
		<content:encoded><![CDATA[<p>Hi Karl, Is the .live() method in 1.3ish just an alias for .clone(true), or does it do other stuff as well?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Working with Events, part 2 &#124; haojii</title>
		<link>http://www.learningjquery.com/2008/05/working-with-events-part-2/comment-page-1#comment-79536</link>
		<dc:creator>Working with Events, part 2 &#124; haojii</dc:creator>
		<pubDate>Tue, 12 Jan 2010 14:05:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/05/working-with-events-part-2#comment-79536</guid>
		<description>[...] 原文地址：http://www.learningjquery.com/2008/05/working-with-events-part-2 原文作者:  Karl Swedberg [...]</description>
		<content:encoded><![CDATA[<p>[...] 原文地址：http://www.learningjquery.com/2008/05/working-with-events-part-2 原文作者:  Karl Swedberg [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://www.learningjquery.com/2008/05/working-with-events-part-2/comment-page-1#comment-79372</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Wed, 16 Dec 2009 01:00:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/05/working-with-events-part-2#comment-79372</guid>
		<description>Hi Karl,

Great post. Absolutely enlightening and helpful. I&#039;ve followed most of what you&#039;ve written in this and the previous post and tried some of it. Here&#039;s where I&#039;m getting stuck:

I have specific target DIVs (let&#039;s call it DTarget) that a user can drop something onto. When they drop something onto it the code adds a new DIV with the thing&#039;s name right after the target  (call it DName) and it adds another DTarget following the new DName. So it ends up looking like:

DTarget
DName
DTarget

The last DTarget is dynamically added so it doesn&#039;t know that it can accept a drop of a DName on it. Making something a droppable target isn&#039;t an event, it&#039;s an attribute of the .droppable method. How do I bind that attribute to the new DTarget?

Thanks, if you get a chance to answer this and thanks in any case. These two posts were still very valuable.

Thomas

&lt;pre&gt;&lt;code&gt;
$(&quot;.DName&quot;).draggable({...});

$(&quot;.DTarget&quot;).droppable({
    accept: &quot;.DName&quot;, 
    drop: function(event, ui) {
        $(this).after(&#039;&lt;div class=&quot;DName&quot;&gt;&#039;  +  things name gotten elsewhere  +  &#039;&lt;/div&gt;&#039;);
        &lt;!-- Tried the clone(true) option here, it copied the element but it wasn&#039;t droppable ??? --&gt;
    }
});&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hi Karl,</p>
<p>Great post. Absolutely enlightening and helpful. I&#8217;ve followed most of what you&#8217;ve written in this and the previous post and tried some of it. Here&#8217;s where I&#8217;m getting stuck:</p>
<p>I have specific target DIVs (let&#8217;s call it DTarget) that a user can drop something onto. When they drop something onto it the code adds a new DIV with the thing&#8217;s name right after the target  (call it DName) and it adds another DTarget following the new DName. So it ends up looking like:</p>
<p>DTarget<br />
DName<br />
DTarget</p>
<p>The last DTarget is dynamically added so it doesn&#8217;t know that it can accept a drop of a DName on it. Making something a droppable target isn&#8217;t an event, it&#8217;s an attribute of the .droppable method. How do I bind that attribute to the new DTarget?</p>
<p>Thanks, if you get a chance to answer this and thanks in any case. These two posts were still very valuable.</p>
<p>Thomas</p>
<pre><code>
$(".DName").draggable({...});

$(".DTarget").droppable({
    accept: ".DName",
    drop: function(event, ui) {
        $(this).after('&lt;div class="DName"&gt;'  +  things name gotten elsewhere  +  '&lt;/div&gt;');
        &lt;!-- Tried the clone(true) option here, it copied the element but it wasn't droppable ??? --&gt;
    }
});</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frequently Asked Questions,Jquery working, &#124; GUI Developer</title>
		<link>http://www.learningjquery.com/2008/05/working-with-events-part-2/comment-page-1#comment-78849</link>
		<dc:creator>Frequently Asked Questions,Jquery working, &#124; GUI Developer</dc:creator>
		<pubDate>Tue, 22 Sep 2009 15:46:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/05/working-with-events-part-2#comment-78849</guid>
		<description>[...] learn more about event re-binding read this article on the Learning jQuery [...]</description>
		<content:encoded><![CDATA[<p>[...] learn more about event re-binding read this article on the Learning jQuery [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Umut Muhaddisoglu</title>
		<link>http://www.learningjquery.com/2008/05/working-with-events-part-2/comment-page-1#comment-77860</link>
		<dc:creator>Umut Muhaddisoglu</dc:creator>
		<pubDate>Tue, 14 Jul 2009 15:06:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/05/working-with-events-part-2#comment-77860</guid>
		<description>Karl,

Thanks so much for this post as it saved me a lot of time and shaked to stop thinking about a silly idea (I was thinking it was the style=&quot;opacity&quot; added automatically via jQuery which prevents the usge of new items, silly me :), I was stuck with that idea.)</description>
		<content:encoded><![CDATA[<p>Karl,</p>
<p>Thanks so much for this post as it saved me a lot of time and shaked to stop thinking about a silly idea (I was thinking it was the style=&#8221;opacity&#8221; added automatically via jQuery which prevents the usge of new items, silly me :), I was stuck with that idea.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2008/05/working-with-events-part-2/comment-page-1#comment-77767</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Thu, 02 Jul 2009 13:22:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/05/working-with-events-part-2#comment-77767</guid>
		<description>Hi Mark, 
I&#039;d put the three &lt;code&gt;select&lt;/code&gt; elements and the submit button in a form. Make sure it works without JavaScript first. Then, use the form submit event rather than the button&#039;s click event to post it via ajax. Something like this:
&lt;pre&gt;&lt;code&gt;
  $(&#039;#myForm&#039;).submit(function() {
    var myData = $(this).serialize();
    $.post(&#039;handler.php&#039;, myData, function() {
      // do something after post success
    });
    return false;
  });
&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hi Mark,<br />
I&#8217;d put the three <code>select</code> elements and the submit button in a form. Make sure it works without JavaScript first. Then, use the form submit event rather than the button&#8217;s click event to post it via ajax. Something like this:</p>
<pre><code>
  $('#myForm').submit(function() {
    var myData = $(this).serialize();
    $.post('handler.php', myData, function() {
      // do something after post success
    });
    return false;
  });
</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.learningjquery.com/2008/05/working-with-events-part-2/comment-page-1#comment-77764</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Thu, 02 Jul 2009 08:22:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/05/working-with-events-part-2#comment-77764</guid>
		<description>Hi karl,

I got a question for you im trying to vind the correct syntax of a combination between button.click and http request.

I got 3 drop down menu&#039;s(week, month and year) where the values got to be posted to the handler .php by a button.click.
But i can&#039;t vind any where the sintax or an explanation can you give me any hints or tips about this?
thank you in advanced Mark</description>
		<content:encoded><![CDATA[<p>Hi karl,</p>
<p>I got a question for you im trying to vind the correct syntax of a combination between button.click and http request.</p>
<p>I got 3 drop down menu&#8217;s(week, month and year) where the values got to be posted to the handler .php by a button.click.<br />
But i can&#8217;t vind any where the sintax or an explanation can you give me any hints or tips about this?<br />
thank you in advanced Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noe Ruiz</title>
		<link>http://www.learningjquery.com/2008/05/working-with-events-part-2/comment-page-1#comment-76646</link>
		<dc:creator>Noe Ruiz</dc:creator>
		<pubDate>Thu, 11 Jun 2009 14:49:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2008/05/working-with-events-part-2#comment-76646</guid>
		<description>Awesome explanation! Love the examples, read through the whole article and comments, but  I still can&#039;t seem to get it work with my example.

I&#039;m trying to implement the add/remove functionality to a table. I&#039;m creating sort of contact form. Here is a quick and simple &lt;a href=&quot;http://www.1450.com/eventTest/index.html&quot; rel=&quot;nofollow&quot;&gt;example.&lt;/a&gt;

So basically I need the button to generate a whole new table row. Any ideas? Appreciate all comments, thank you in advanced!</description>
		<content:encoded><![CDATA[<p>Awesome explanation! Love the examples, read through the whole article and comments, but  I still can&#8217;t seem to get it work with my example.</p>
<p>I&#8217;m trying to implement the add/remove functionality to a table. I&#8217;m creating sort of contact form. Here is a quick and simple <a href="http://www.1450.com/eventTest/index.html" rel="nofollow">example.</a></p>
<p>So basically I need the button to generate a whole new table row. Any ideas? Appreciate all comments, thank you in advanced!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
