<?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: this.options &#8211; setting defaults that can be overwritten in your classes</title>
	<atom:link href="http://www.clientcide.com/best-practices/thisoptions-setting-defaults-that-can-be-overwritten-in-your-classes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.clientcide.com/best-practices/thisoptions-setting-defaults-that-can-be-overwritten-in-your-classes/</link>
	<description>Making stuff work on the other side of the request.</description>
	<lastBuildDate>Thu, 12 Jan 2012 20:00:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Beware: object = object has a pitfall &#187; Clientside</title>
		<link>http://www.clientcide.com/best-practices/thisoptions-setting-defaults-that-can-be-overwritten-in-your-classes/comment-page-1/#comment-4073</link>
		<dc:creator>Beware: object = object has a pitfall &#187; Clientside</dc:creator>
		<pubDate>Sat, 13 Jan 2007 01:54:11 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/best-practices/thisoptions-setting-defaults-that-can-be-overwritten-in-your-classes/#comment-4073</guid>
		<description>[...] So I spent an entire day discovering a quirk about javascript that I must now share. In a previous post on creating default settings for classes/objects I discussed the following technique:  PLAIN TEXT JavaScript:  var Widget = new Class&#40;&#123; initialize: function&#40;element, options&#41;&#123; this.element = element; this.options = Object.extend&#40;&#123; offsetX: 0, offsetY: 0 &#125;, options &#124;&#124; &#123;&#125;&#41;; this.setPosition&#40;&#41;; &#125;, setPosition: function&#40;&#41;&#123; this.element.setStyles&#40;&#123; left: this.options.offsetX + &#039;px&#039;, top: this.options.offsetY + &#039;px&#039; &#125;&#41;; &#125; &#125;&#41;; [...]</description>
		<content:encoded><![CDATA[<p>[...] So I spent an entire day discovering a quirk about javascript that I must now share. In a previous post on creating default settings for classes/objects I discussed the following technique:  PLAIN TEXT JavaScript:  var Widget = new Class&#40;&#123; initialize: function&#40;element, options&#41;&#123; this.element = element; this.options = Object.extend&#40;&#123; offsetX: 0, offsetY: 0 &#125;, options || &#123;&#125;&#41;; this.setPosition&#40;&#41;; &#125;, setPosition: function&#40;&#41;&#123; this.element.setStyles&#40;&#123; left: this.options.offsetX + &#8216;px&#8217;, top: this.options.offsetY + &#8216;px&#8217; &#125;&#41;; &#125; &#125;&#41;; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron N.</title>
		<link>http://www.clientcide.com/best-practices/thisoptions-setting-defaults-that-can-be-overwritten-in-your-classes/comment-page-1/#comment-65</link>
		<dc:creator>Aaron N.</dc:creator>
		<pubDate>Mon, 20 Nov 2006 16:45:06 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/best-practices/thisoptions-setting-defaults-that-can-be-overwritten-in-your-classes/#comment-65</guid>
		<description>Hi Cody,

I really appreciate you sharing this example, but I don&#039;t think it&#039;s quite the same concept. The way that my example above works lets you set defaults and the user passes in their own options that overwrite any portion of those defaults. In your tooltip example, you add a bunch of options together with those passed in, but the user doesn&#039;t have any way to alter the defaults.</description>
		<content:encoded><![CDATA[<p>Hi Cody,</p>
<p>I really appreciate you sharing this example, but I don&#8217;t think it&#8217;s quite the same concept. The way that my example above works lets you set defaults and the user passes in their own options that overwrite any portion of those defaults. In your tooltip example, you add a bunch of options together with those passed in, but the user doesn&#8217;t have any way to alter the defaults.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cody lindley</title>
		<link>http://www.clientcide.com/best-practices/thisoptions-setting-defaults-that-can-be-overwritten-in-your-classes/comment-page-1/#comment-64</link>
		<dc:creator>cody lindley</dc:creator>
		<pubDate>Sat, 18 Nov 2006 13:51:49 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/best-practices/thisoptions-setting-defaults-that-can-be-overwritten-in-your-classes/#comment-64</guid>
		<description>A great coding example of this is the following prototype tooltip code:

http://blog.innerewut.de/files/tooltip/tooltip-v0.1.js</description>
		<content:encoded><![CDATA[<p>A great coding example of this is the following prototype tooltip code:</p>
<p><a href="http://blog.innerewut.de/files/tooltip/tooltip-v0.1.js" rel="nofollow">http://blog.innerewut.de/files/tooltip/tooltip-v0.1.js</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron N.</title>
		<link>http://www.clientcide.com/best-practices/thisoptions-setting-defaults-that-can-be-overwritten-in-your-classes/comment-page-1/#comment-61</link>
		<dc:creator>Aaron N.</dc:creator>
		<pubDate>Wed, 15 Nov 2006 02:07:49 +0000</pubDate>
		<guid isPermaLink="false">http://clientside.cnet.com/best-practices/thisoptions-setting-defaults-that-can-be-overwritten-in-your-classes/#comment-61</guid>
		<description>In my haste to just throw this up, my example had a couple of errors. Despite the fact that there&#039;s no reason to execute this to illustrate the point, I don&#039;t want to confuse anyone; I&#039;ve updated the examples.</description>
		<content:encoded><![CDATA[<p>In my haste to just throw this up, my example had a couple of errors. Despite the fact that there&#8217;s no reason to execute this to illustrate the point, I don&#8217;t want to confuse anyone; I&#8217;ve updated the examples.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

