<?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: The differences between Callbacks and Events</title>
	<atom:link href="http://ajaxian.com/archives/the-differences-between-callbacks-and-events/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/the-differences-between-callbacks-and-events</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 09 Feb 2012 06:55:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<item>
		<title>By: NOSLOW</title>
		<link>http://ajaxian.com/archives/the-differences-between-callbacks-and-events/comment-page-1#comment-272521</link>
		<dc:creator>NOSLOW</dc:creator>
		<pubDate>Fri, 03 Apr 2009 14:42:12 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6459#comment-272521</guid>
		<description>@MikaMTB31: I agree. In Firefox, I&#039;ve added these 2 lines to my userContent.css file:

&lt;code&gt;
div#wrapper div#pagebody div#maincontent {min-width:744px !important;}
div#wrapper div#pagebody div#maincontent div.entry div.syntax_hilite {min-width: 727px !important}
&lt;/code&gt;

Or checkout the &quot;Stylish&quot; Add-on to do the same thing: https://addons.mozilla.org/en-US/firefox/addon/2108</description>
		<content:encoded><![CDATA[<p>@MikaMTB31: I agree. In Firefox, I&#8217;ve added these 2 lines to my userContent.css file:</p>
<p><code><br />
div#wrapper div#pagebody div#maincontent {min-width:744px !important;}<br />
div#wrapper div#pagebody div#maincontent div.entry div.syntax_hilite {min-width: 727px !important}<br />
</code></p>
<p>Or checkout the &#8220;Stylish&#8221; Add-on to do the same thing: <a href="https://addons.mozilla.org/en-US/firefox/addon/2108" rel="nofollow">https://addons.mozilla.org/en-US/firefox/addon/2108</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: minkeytorture</title>
		<link>http://ajaxian.com/archives/the-differences-between-callbacks-and-events/comment-page-1#comment-272511</link>
		<dc:creator>minkeytorture</dc:creator>
		<pubDate>Thu, 02 Apr 2009 21:22:30 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6459#comment-272511</guid>
		<description>Incidentally, the example provided fails in MooTools 1.2.1 as well.</description>
		<content:encoded><![CDATA[<p>Incidentally, the example provided fails in MooTools 1.2.1 as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BarelyFitz</title>
		<link>http://ajaxian.com/archives/the-differences-between-callbacks-and-events/comment-page-1#comment-272482</link>
		<dc:creator>BarelyFitz</dc:creator>
		<pubDate>Wed, 01 Apr 2009 14:43:54 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6459#comment-272482</guid>
		<description>@warfangle: That would be possible, but it is not desireable because you would be throwing away any exceptions, so it would be impossible to debug problems that occur.

@deanedwards: Great to see a solution! A couple years ago I tried to solve this using try/catch and storing each exception in an array - ha,  that totally didn&#039;t work (a little knowledge can be a dangerous thing!)

Here&#039;s hoping the frameworks (other than Prototype which got it right) will be updated to behave this way.</description>
		<content:encoded><![CDATA[<p>@warfangle: That would be possible, but it is not desireable because you would be throwing away any exceptions, so it would be impossible to debug problems that occur.</p>
<p>@deanedwards: Great to see a solution! A couple years ago I tried to solve this using try/catch and storing each exception in an array &#8211; ha,  that totally didn&#8217;t work (a little knowledge can be a dangerous thing!)</p>
<p>Here&#8217;s hoping the frameworks (other than Prototype which got it right) will be updated to behave this way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: warfangle</title>
		<link>http://ajaxian.com/archives/the-differences-between-callbacks-and-events/comment-page-1#comment-272445</link>
		<dc:creator>warfangle</dc:creator>
		<pubDate>Tue, 31 Mar 2009 22:17:48 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6459#comment-272445</guid>
		<description>Wouldn&#039;t it be possible, theoretically, to do this?

// loop through listeners and :
try {
// call listener
} catch(e) {
continue;
}</description>
		<content:encoded><![CDATA[<p>Wouldn&#8217;t it be possible, theoretically, to do this?</p>
<p>// loop through listeners and :<br />
try {<br />
// call listener<br />
} catch(e) {<br />
continue;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: deanedwards</title>
		<link>http://ajaxian.com/archives/the-differences-between-callbacks-and-events/comment-page-1#comment-272437</link>
		<dc:creator>deanedwards</dc:creator>
		<pubDate>Tue, 31 Mar 2009 19:47:40 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6459#comment-272437</guid>
		<description>@BarelyFitz, I provide a solution to the problem - wrap the callback system in a real event. It works.</description>
		<content:encoded><![CDATA[<p>@BarelyFitz, I provide a solution to the problem &#8211; wrap the callback system in a real event. It works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BarelyFitz</title>
		<link>http://ajaxian.com/archives/the-differences-between-callbacks-and-events/comment-page-1#comment-272428</link>
		<dc:creator>BarelyFitz</dc:creator>
		<pubDate>Tue, 31 Mar 2009 15:28:04 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6459#comment-272428</guid>
		<description>I banged my head against this problem for quite a while using Dojo a couple years ago. This presents a real problem for creating modular systems - you add one new component to a page, and it can bring down anything that executes after it.

As fjakobs mentions, the hard part about this is handling errors in an intelligent way. I was never able to hack together anything that would work reliably, but hopefully someone will come up with a solution.</description>
		<content:encoded><![CDATA[<p>I banged my head against this problem for quite a while using Dojo a couple years ago. This presents a real problem for creating modular systems &#8211; you add one new component to a page, and it can bring down anything that executes after it.</p>
<p>As fjakobs mentions, the hard part about this is handling errors in an intelligent way. I was never able to hack together anything that would work reliably, but hopefully someone will come up with a solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: howardrauscher</title>
		<link>http://ajaxian.com/archives/the-differences-between-callbacks-and-events/comment-page-1#comment-272426</link>
		<dc:creator>howardrauscher</dc:creator>
		<pubDate>Tue, 31 Mar 2009 15:10:25 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6459#comment-272426</guid>
		<description>There is a good debate about this article over on the jquery dev mailing list with Dean Edwards, John Resig, and others

http://groups.google.com/group/jquery-dev/browse_thread/thread/2a14c2da6bcbb5f/c257fa0900c97457?lnk=gst&amp;q=callback+event#c257fa0900c97457</description>
		<content:encoded><![CDATA[<p>There is a good debate about this article over on the jquery dev mailing list with Dean Edwards, John Resig, and others</p>
<p><a href="http://groups.google.com/group/jquery-dev/browse_thread/thread/2a14c2da6bcbb5f/c257fa0900c97457?lnk=gst&#038;q=callback+event#c257fa0900c97457" rel="nofollow">http://groups.google.com/group/jquery-dev/browse_thread/thread/2a14c2da6bcbb5f/c257fa0900c97457?lnk=gst&#038;q=callback+event#c257fa0900c97457</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fjakobs</title>
		<link>http://ajaxian.com/archives/the-differences-between-callbacks-and-events/comment-page-1#comment-272425</link>
		<dc:creator>fjakobs</dc:creator>
		<pubDate>Tue, 31 Mar 2009 14:59:52 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6459#comment-272425</guid>
		<description>I think it&#039;s fair for a framework to behave like that. The alternatives would be:

1.) Wrap each listener into a try ... catch block and throw the error after all other listeners have finished. This is really hard to debug because in most browser&#039;s you loose the context of the exception.

2.) Call the listeners asynchronously with a timeout. This absolutely kills performance. 

3.) A combination of both. Wrap the listeners in a try ... catch block and only if an exception occurs call the remaining listeners asynchronously. The exception can be rethrown immediately after calling setTimeout.

Out of these options I think only the last one seems to make some sense to me. But considering the benefit it&#039;s probably add just another level of unjustified additional complexity.</description>
		<content:encoded><![CDATA[<p>I think it&#8217;s fair for a framework to behave like that. The alternatives would be:</p>
<p>1.) Wrap each listener into a try &#8230; catch block and throw the error after all other listeners have finished. This is really hard to debug because in most browser&#8217;s you loose the context of the exception.</p>
<p>2.) Call the listeners asynchronously with a timeout. This absolutely kills performance. </p>
<p>3.) A combination of both. Wrap the listeners in a try &#8230; catch block and only if an exception occurs call the remaining listeners asynchronously. The exception can be rethrown immediately after calling setTimeout.</p>
<p>Out of these options I think only the last one seems to make some sense to me. But considering the benefit it&#8217;s probably add just another level of unjustified additional complexity.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MikaMTB31</title>
		<link>http://ajaxian.com/archives/the-differences-between-callbacks-and-events/comment-page-1#comment-272424</link>
		<dc:creator>MikaMTB31</dc:creator>
		<pubDate>Tue, 31 Mar 2009 13:18:51 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6459#comment-272424</guid>
		<description>When are you guys going to give us wider columns ? This is getting ridiculous, I&#039;m sick of scrolling to read code.</description>
		<content:encoded><![CDATA[<p>When are you guys going to give us wider columns ? This is getting ridiculous, I&#8217;m sick of scrolling to read code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

