<?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: How to refresh listeners in Prototype</title>
	<atom:link href="http://bkwld.com/blog/2008/06/how-to-refresh-listeners-in-prototype/feed/" rel="self" type="application/rss+xml" />
	<link>http://bkwld.com/blog/2008/06/how-to-refresh-listeners-in-prototype/</link>
	<description>The blog from the staff of BKWLD</description>
	<lastBuildDate>Tue, 01 May 2012 11:14:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: kangax</title>
		<link>http://bkwld.com/blog/2008/06/how-to-refresh-listeners-in-prototype/comment-page-1/#comment-4514</link>
		<dc:creator>kangax</dc:creator>
		<pubDate>Tue, 17 Jun 2008 19:32:51 +0000</pubDate>
		<guid isPermaLink="false">http://team.bkwld.com/2008/06/15/how-to-refresh-listeners-in-prototype/#comment-4514</guid>
		<description>I see your point.
Event delegation is obviously not a silver bullet. 
It could be very well not worth it, but performing a tiny operation on every click usually leads to a better performance (vs. having N event handlers in memory)</description>
		<content:encoded><![CDATA[<p>I see your point.<br />
Event delegation is obviously not a silver bullet.<br />
It could be very well not worth it, but performing a tiny operation on every click usually leads to a better performance (vs. having N event handlers in memory)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garrett</title>
		<link>http://bkwld.com/blog/2008/06/how-to-refresh-listeners-in-prototype/comment-page-1/#comment-4506</link>
		<dc:creator>Garrett</dc:creator>
		<pubDate>Mon, 16 Jun 2008 22:30:39 +0000</pubDate>
		<guid isPermaLink="false">http://team.bkwld.com/2008/06/15/how-to-refresh-listeners-in-prototype/#comment-4506</guid>
		<description>Maybe not a memory leak, but just the overall viewpoint of it...listening to every click where its not needed, over listening to double clicks on elements that are needed should be targeted that way. That is were I think the if statements are bloated and not needed.

Let me mention that I changed my double click listener to a simple single for this post.</description>
		<content:encoded><![CDATA[<p>Maybe not a memory leak, but just the overall viewpoint of it&#8230;listening to every click where its not needed, over listening to double clicks on elements that are needed should be targeted that way. That is were I think the if statements are bloated and not needed.</p>
<p>Let me mention that I changed my double click listener to a simple single for this post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kangax</title>
		<link>http://bkwld.com/blog/2008/06/how-to-refresh-listeners-in-prototype/comment-page-1/#comment-4505</link>
		<dc:creator>kangax</dc:creator>
		<pubDate>Mon, 16 Jun 2008 21:52:34 +0000</pubDate>
		<guid isPermaLink="false">http://team.bkwld.com/2008/06/15/how-to-refresh-listeners-in-prototype/#comment-4505</guid>
		<description>I don&#039;t see why there would be a leak. There seems to be no circular references created (if you are referring to IE&#039; s bug). I&#039;ve  been using event delegation for quite some time lately and performance gains are usually pretty noticeable.

- kangax</description>
		<content:encoded><![CDATA[<p>I don&#8217;t see why there would be a leak. There seems to be no circular references created (if you are referring to IE&#8217; s bug). I&#8217;ve  been using event delegation for quite some time lately and performance gains are usually pretty noticeable.</p>
<p>- kangax</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garrett</title>
		<link>http://bkwld.com/blog/2008/06/how-to-refresh-listeners-in-prototype/comment-page-1/#comment-4497</link>
		<dc:creator>Garrett</dc:creator>
		<pubDate>Mon, 16 Jun 2008 04:34:28 +0000</pubDate>
		<guid isPermaLink="false">http://team.bkwld.com/2008/06/15/how-to-refresh-listeners-in-prototype/#comment-4497</guid>
		<description>Won&#039;t there be a memory leak over time, listening to &lt;em&gt;every&lt;/em&gt; click and doing if statements all over? Instead of adding the listener to the actual element?</description>
		<content:encoded><![CDATA[<p>Won&#8217;t there be a memory leak over time, listening to <em>every</em> click and doing if statements all over? Instead of adding the listener to the actual element?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kangax</title>
		<link>http://bkwld.com/blog/2008/06/how-to-refresh-listeners-in-prototype/comment-page-1/#comment-4488</link>
		<dc:creator>kangax</dc:creator>
		<pubDate>Sun, 15 Jun 2008 20:17:40 +0000</pubDate>
		<guid isPermaLink="false">http://team.bkwld.com/2008/06/15/how-to-refresh-listeners-in-prototype/#comment-4488</guid>
		<description>This is actually an overkill.
Event delegation seems more appropriate here.
Try this:

document.observe(&#039;click&#039;, function(e) {
  var target = e.findElement(&#039;tr[rel=file]&#039;);
  if(!target) return;
  e.stop();
  // send request, etc.
})

Best,
kangax</description>
		<content:encoded><![CDATA[<p>This is actually an overkill.<br />
Event delegation seems more appropriate here.<br />
Try this:</p>
<p>document.observe(&#8216;click&#8217;, function(e) {<br />
  var target = e.findElement(&#8216;tr[rel=file]&#8216;);<br />
  if(!target) return;<br />
  e.stop();<br />
  // send request, etc.<br />
})</p>
<p>Best,<br />
kangax</p>
]]></content:encoded>
	</item>
</channel>
</rss>

