<?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: jQuery evangelism</title>
	<atom:link href="http://rc3.org/2008/03/10/jquery-evangelism/feed/" rel="self" type="application/rss+xml" />
	<link>http://rc3.org/2008/03/10/jquery-evangelism/</link>
	<description>Strong opinions weakly held</description>
	<lastBuildDate>Mon, 15 Mar 2010 16:30:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: P</title>
		<link>http://rc3.org/2008/03/10/jquery-evangelism/comment-page-1/#comment-3341</link>
		<dc:creator>P</dc:creator>
		<pubDate>Tue, 09 Dec 2008 21:05:45 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/2008/03/10/jquery-evangelism/#comment-3341</guid>
		<description>&lt;p&gt;If there are any select menu element values to copy, you can add them to the Xpath selector:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$(&quot;#shipping_fieldset input, #shipping_fieldset select&quot;).each(function() {
    var elem = $(this);
    $(&quot;#billing_fieldset #&quot;+ 
        elem.attr(&quot;id&quot;).replace(/shipping/, &quot;billing&quot;)).val(elem.val());
});
&lt;/code&gt;&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>If there are any select menu element values to copy, you can add them to the Xpath selector:</p>

<pre><code>$("#shipping_fieldset input, #shipping_fieldset select").each(function() {
    var elem = $(this);
    $("#billing_fieldset #"+ 
        elem.attr("id").replace(/shipping/, "billing")).val(elem.val());
});
</code></pre>]]></content:encoded>
	</item>
	<item>
		<title>By: Rafe</title>
		<link>http://rc3.org/2008/03/10/jquery-evangelism/comment-page-1/#comment-2539</link>
		<dc:creator>Rafe</dc:creator>
		<pubDate>Wed, 26 Mar 2008 17:01:50 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/2008/03/10/jquery-evangelism/#comment-2539</guid>
		<description>&lt;p&gt;Great comment.  Thanks for the illumination.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Great comment.  Thanks for the illumination.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Asbjørn Ulsberg</title>
		<link>http://rc3.org/2008/03/10/jquery-evangelism/comment-page-1/#comment-2537</link>
		<dc:creator>Asbjørn Ulsberg</dc:creator>
		<pubDate>Wed, 26 Mar 2008 16:16:53 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/2008/03/10/jquery-evangelism/#comment-2537</guid>
		<description>&lt;p&gt;Yes, jQuery is fantastic. I&#039;d simplify your first example to something like this, though:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$(function() {
  $(&quot;#sameAsPhysical&quot;).change(function() {
    if (this.checked) {
      $(&quot;#physical input&quot;).each(function() {
        var self = $(this);
        $(&quot;#billing input[name=&#039;&quot; +
            self.attr(&quot;name&quot;).replace(/physical/, &quot;billing&quot;) +
          &quot;&#039;]&quot;).val(self.val());
      });
    }
  });
});&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Not tested in any way, but the point is to not do &lt;code&gt;$(this)&lt;/code&gt; too many times and to utilize the shortcuts available in jQuery, like &lt;code&gt;$(function() {})&lt;/code&gt; instead of &lt;code&gt;$(document).ready(function() {})&lt;/code&gt; and &lt;code&gt;this&lt;/code&gt; instead of &lt;code&gt;event.target&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;With the &lt;a href=&quot;http://plugins.jquery.com/project/printf&quot; rel=&quot;nofollow&quot;&gt;jQuery printf plugin&lt;/a&gt;, you can rewrite the string concatenation bit to something like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$($.sprintf(&quot;#billing input[name=&#039;%s&#039;]&quot;,
  self.attr(&quot;name&quot;).replace(/physical/, &quot;billing&quot;)
)).val(self.val());&lt;/pre&gt;

&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yes, jQuery is fantastic. I&#8217;d simplify your first example to something like this, though:</p>

<pre><code>$(function() {
  $("#sameAsPhysical").change(function() {
    if (this.checked) {
      $("#physical input").each(function() {
        var self = $(this);
        $("#billing input[name='" +
            self.attr("name").replace(/physical/, "billing") +
          "']").val(self.val());
      });
    }
  });
});</code></pre>

<p>Not tested in any way, but the point is to not do <code>$(this)</code> too many times and to utilize the shortcuts available in jQuery, like <code>$(function() {})</code> instead of <code>$(document).ready(function() {})</code> and <code>this</code> instead of <code>event.target</code>.</p>

<p>With the <a href="http://plugins.jquery.com/project/printf" rel="nofollow">jQuery printf plugin</a>, you can rewrite the string concatenation bit to something like this:</p>

<pre><code>$($.sprintf("#billing input[name='%s']",
  self.attr("name").replace(/physical/, "billing")
)).val(self.val());</code></pre>

<p></p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marc Novakowski</title>
		<link>http://rc3.org/2008/03/10/jquery-evangelism/comment-page-1/#comment-2464</link>
		<dc:creator>Marc Novakowski</dc:creator>
		<pubDate>Tue, 11 Mar 2008 07:04:55 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/2008/03/10/jquery-evangelism/#comment-2464</guid>
		<description>&lt;p&gt;We&#039;ve been using jQuery for a while now on the &quot;backstage&quot; webpages at Pandora.com (i.e. profile page, artist/album/track detail pages) and it&#039;s great.  It makes DHTML and Ajax soooo much easier!&lt;/p&gt;

&lt;p&gt;The nice thing too is that it&#039;s a very active project, and they are always adding new things and making it faster (yet, somehow keeping it fairly simple to use).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>We&#8217;ve been using jQuery for a while now on the &#8220;backstage&#8221; webpages at Pandora.com (i.e. profile page, artist/album/track detail pages) and it&#8217;s great.  It makes DHTML and Ajax soooo much easier!</p>

<p>The nice thing too is that it&#8217;s a very active project, and they are always adding new things and making it faster (yet, somehow keeping it fairly simple to use).</p>]]></content:encoded>
	</item>
</channel>
</rss>
