<?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: Javascript Looping Object Instance&#8217;s Method Problem</title>
	<atom:link href="http://cssquirrel.com/2009/06/03/javascript-looping-object-instances-method-problem/feed/" rel="self" type="application/rss+xml" />
	<link>http://cssquirrel.com/blog/2009/06/03/javascript-looping-object-instances-method-problem/</link>
	<description>opinions and news on web design</description>
	<lastBuildDate>Thu, 17 May 2012 05:41:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: zedzdead</title>
		<link>http://cssquirrel.com/blog/2009/06/03/javascript-looping-object-instances-method-problem/comment-page-1/#comment-25279</link>
		<dc:creator>zedzdead</dc:creator>
		<pubDate>Mon, 08 Jun 2009 11:01:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.cssquirrel.com/?p=303#comment-25279</guid>
		<description>You could always follow http://twitter.com/ioubeer (http://foamee.com/)and @danieltott.

Rather freakily somebody has @ioubeer&#039;d dan lately!</description>
		<content:encoded><![CDATA[<p>You could always follow <a href="http://twitter.com/ioubeer" rel="nofollow">http://twitter.com/ioubeer</a> (<a href="http://foamee.com/" rel="nofollow">http://foamee.com/</a>)and @danieltott.</p>
<p>Rather freakily somebody has @ioubeer&#8217;d dan lately!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Ott</title>
		<link>http://cssquirrel.com/blog/2009/06/03/javascript-looping-object-instances-method-problem/comment-page-1/#comment-25171</link>
		<dc:creator>Dan Ott</dc:creator>
		<pubDate>Wed, 03 Jun 2009 18:17:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.cssquirrel.com/?p=303#comment-25171</guid>
		<description>@Kyle No cake? What a ripoff(:

Glad to help.</description>
		<content:encoded><![CDATA[<p>@Kyle No cake? What a ripoff(:</p>
<p>Glad to help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle Weems</title>
		<link>http://cssquirrel.com/blog/2009/06/03/javascript-looping-object-instances-method-problem/comment-page-1/#comment-25170</link>
		<dc:creator>Kyle Weems</dc:creator>
		<pubDate>Wed, 03 Jun 2009 18:15:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.cssquirrel.com/?p=303#comment-25170</guid>
		<description>@Dan - I thought it was a scope issue, but I just couldn&#039;t figure out how to sidestep that. 

Thanks! That seems to have nailed the issue I was having.

You, sir, are awesome and deserve a piece of cake.

I, sadly, don&#039;t have any cake to give you.</description>
		<content:encoded><![CDATA[<p>@Dan &#8211; I thought it was a scope issue, but I just couldn&#8217;t figure out how to sidestep that. </p>
<p>Thanks! That seems to have nailed the issue I was having.</p>
<p>You, sir, are awesome and deserve a piece of cake.</p>
<p>I, sadly, don&#8217;t have any cake to give you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Ott</title>
		<link>http://cssquirrel.com/blog/2009/06/03/javascript-looping-object-instances-method-problem/comment-page-1/#comment-25169</link>
		<dc:creator>Dan Ott</dc:creator>
		<pubDate>Wed, 03 Jun 2009 17:53:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.cssquirrel.com/?p=303#comment-25169</guid>
		<description>This scope of the callback function changes, so when you say &quot;this.greet&quot; inside the callback function, it thinks &quot;this&quot; is the callback function, not the original object.

One really easy way to get around that:
&lt;code&gt;
var myObj = this;
if(this.count &lt; 2) {
			$(&#039;body&#039;).animate({&quot;opacity&quot;:1}, 1000, function(){myObj.greet();});
		}
&lt;/code&gt;

That should take care of it.</description>
		<content:encoded><![CDATA[<p>This scope of the callback function changes, so when you say &#8220;this.greet&#8221; inside the callback function, it thinks &#8220;this&#8221; is the callback function, not the original object.</p>
<p>One really easy way to get around that:<br />
<code><br />
var myObj = this;<br />
if(this.count &lt; 2) {<br />
			$('body').animate({"opacity":1}, 1000, function(){myObj.greet();});<br />
		}<br />
</code></p>
<p>That should take care of it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

