<?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: WillPaginate with ajax and unobtrusive js</title>
	<atom:link href="http://gravityblast.com/2008/03/25/will_paginate-with-ajax-and-unobtrusive-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://gravityblast.com/2008/03/25/will_paginate-with-ajax-and-unobtrusive-javascript/</link>
	<description>...coding blast beat!</description>
	<lastBuildDate>Wed, 14 Apr 2010 21:27:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Reggie</title>
		<link>http://gravityblast.com/2008/03/25/will_paginate-with-ajax-and-unobtrusive-javascript/comment-page-1/#comment-33</link>
		<dc:creator>Reggie</dc:creator>
		<pubDate>Mon, 21 Apr 2008 14:11:58 +0000</pubDate>
		<guid isPermaLink="false">http://gravityblast.com/2008/03/25/will_paginate-with-ajax-and-unobtrusive-javascript/#comment-33</guid>
		<description>The thing I like the most (and after finding it here I searched for) is the way you used to make the initialization. Sometimes people just arrived to Javascript, make initialization doing something like


  initialize: function(options) {
    if (options) {
      this.options = {};
      this.options.container = options.container &#124;&#124; &#039;container&#039;;
      this.options.selector = options.selector &#124;&#124; &#039;a&#039;;
      /* any other option */
  },  


I did it till now, when I searched about your way to make initialization. The good part is that with prototype you can use Object#extend to copy all the properties from one object to another. So we can have


  initialize: function(options) {
    this.options = Object.extend({
      container: &#039;container&#039;,
      selector:  &#039;a&#039;
      /* any other option */
    }, options &#124;&#124; {});
  },  


In this way the code became much more readable, because you *firstly* set all the default options, and then you change them just using the arguments.</description>
		<content:encoded><![CDATA[<p>The thing I like the most (and after finding it here I searched for) is the way you used to make the initialization. Sometimes people just arrived to Javascript, make initialization doing something like</p>
<p>  initialize: function(options) {<br />
    if (options) {<br />
      this.options = {};<br />
      this.options.container = options.container || &#8216;container&#8217;;<br />
      this.options.selector = options.selector || &#8216;a&#8217;;<br />
      /* any other option */<br />
  },  </p>
<p>I did it till now, when I searched about your way to make initialization. The good part is that with prototype you can use Object#extend to copy all the properties from one object to another. So we can have</p>
<p>  initialize: function(options) {<br />
    this.options = Object.extend({<br />
      container: &#8216;container&#8217;,<br />
      selector:  &#8216;a&#8217;<br />
      /* any other option */<br />
    }, options || {});<br />
  },  </p>
<p>In this way the code became much more readable, because you *firstly* set all the default options, and then you change them just using the arguments.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
