<?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"
	>
<channel>
	<title>Comments on: Breaking Prototype habits in a jQuery world</title>
	<atom:link href="http://www.pathf.com/blogs/2008/03/breaking-protot/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pathf.com/blogs/2008/03/breaking-protot/</link>
	<description>Running commentary about agile development, user experience design and Ajax.</description>
	<pubDate>Wed, 20 Aug 2008 08:03:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Brian Dillard</title>
		<link>http://www.pathf.com/blogs/2008/03/breaking-protot/#comment-54</link>
		<dc:creator>Brian Dillard</dc:creator>
		<pubDate>Mon, 07 Apr 2008 18:56:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=41#comment-54</guid>
		<description>&lt;p&gt;@rimmer333: I don't think that works. I'm using 1.2.3 and hover needs 2 arguments: one function each for the mouseover and mouseout states.&lt;/p&gt;

&lt;p&gt;@jdalton: Totally agreed with your analysis. I think both libraries offer pretty similar functionality but differ in the way they trade off elegance and power.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>@rimmer333: I don&#8217;t think that works. I&#8217;m using 1.2.3 and hover needs 2 arguments: one function each for the mouseover and mouseout states.</p>
<p>@jdalton: Totally agreed with your analysis. I think both libraries offer pretty similar functionality but differ in the way they trade off elegance and power.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jdalton</title>
		<link>http://www.pathf.com/blogs/2008/03/breaking-protot/#comment-53</link>
		<dc:creator>jdalton</dc:creator>
		<pubDate>Thu, 03 Apr 2008 15:41:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=41#comment-53</guid>
		<description>&lt;p&gt;I believe jQuery can avoid the use of “each” because its selector method, $(),&lt;br /&gt;
returns an instance of the jQuery object that has the mentioned method, "click",&lt;br /&gt;
and others attached.&lt;/p&gt;

&lt;p&gt;In Prototype the selector method, $$(), returns an array.&lt;br /&gt;
You can then use the 'invoke' method to call a method of each of its items.&lt;/p&gt;

&lt;p&gt;$$('a.offsite, a.offsiteWide').invoke('observe', 'click', function(){&lt;br /&gt;
var width = this.hasClassName('offsiteWide') ? 1050 : 800;&lt;br /&gt;
.....&lt;/p&gt;

&lt;p&gt;At first glance this may seem unnecessarily verbose but the real power comes in&lt;br /&gt;
not being limited to the methods attached to the array (or the jQuery object).&lt;/p&gt;

&lt;p&gt;For example on an array of strings I can call ‘truncate’:&lt;br /&gt;
arrStrings = arrStrings.invoke('truncate', 10);&lt;/p&gt;

&lt;p&gt;Or on an array of dev defined objects:&lt;br /&gt;
var calculations  = arrCalcs.invoke(‘doComplexCalculations’, arg1, arg2);&lt;/p&gt;

&lt;p&gt;It's chainable as well:&lt;br /&gt;
$$('#windows div.close').invoke('addClassName', 'active').invoke('show'); &lt;/p&gt;

&lt;p&gt;Your “take-home” can be applied to Prototype as well.&lt;br /&gt;
Great article, just though I should clarify some of the prototype info. :)&lt;/p&gt;

&lt;p&gt;-JDD&lt;br /&gt;
&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I believe jQuery can avoid the use of “each” because its selector method, $(),<br />
returns an instance of the jQuery object that has the mentioned method, &#8220;click&#8221;,<br />
and others attached.</p>
<p>In Prototype the selector method, $$(), returns an array.<br />
You can then use the &#8216;invoke&#8217; method to call a method of each of its items.</p>
<p>$$(&#8217;a.offsite, a.offsiteWide&#8217;).invoke(&#8217;observe&#8217;, &#8216;click&#8217;, function(){<br />
var width = this.hasClassName(&#8217;offsiteWide&#8217;) ? 1050 : 800;<br />
&#8230;..</p>
<p>At first glance this may seem unnecessarily verbose but the real power comes in<br />
not being limited to the methods attached to the array (or the jQuery object).</p>
<p>For example on an array of strings I can call ‘truncate’:<br />
arrStrings = arrStrings.invoke(&#8217;truncate&#8217;, 10);</p>
<p>Or on an array of dev defined objects:<br />
var calculations  = arrCalcs.invoke(‘doComplexCalculations’, arg1, arg2);</p>
<p>It&#8217;s chainable as well:<br />
$$(&#8217;#windows div.close&#8217;).invoke(&#8217;addClassName&#8217;, &#8216;active&#8217;).invoke(&#8217;show&#8217;); </p>
<p>Your “take-home” can be applied to Prototype as well.<br />
Great article, just though I should clarify some of the prototype info. <img src='http://www.pathf.com/blogs/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>-JDD</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rimmer333</title>
		<link>http://www.pathf.com/blogs/2008/03/breaking-protot/#comment-52</link>
		<dc:creator>rimmer333</dc:creator>
		<pubDate>Thu, 03 Apr 2008 11:47:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=41#comment-52</guid>
		<description>&lt;p&gt;as of jQuery 1.2 you can rewrite the last part of the last example this way:&lt;/p&gt;

&lt;p&gt;.hover(&lt;br /&gt;
function() {&lt;br /&gt;
$(this).toggleClass('hover');&lt;br /&gt;
}&lt;br /&gt;
);&lt;/p&gt;

&lt;p&gt;All of your other examples still have a lot to polish.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>as of jQuery 1.2 you can rewrite the last part of the last example this way:</p>
<p>.hover(<br />
function() {<br />
$(this).toggleClass(&#8217;hover&#8217;);<br />
}<br />
);</p>
<p>All of your other examples still have a lot to polish.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
