<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
	>
<channel>
	<title>Comments on: dojo.hitch and scope &#8211; more romance</title>
	<atom:link href="http://dojocampus.org/content/2008/07/15/dojohitch-and-scope-again/feed/" rel="self" type="application/rss+xml" />
	<link>http://dojocampus.org/content/2008/07/15/dojohitch-and-scope-again/</link>
	<description>The definitive resource for all things Dojo: past, present, future.</description>
	<lastBuildDate>Wed, 10 Mar 2010 18:40:27 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: sfoster</title>
		<link>http://dojocampus.org/content/2008/07/15/dojohitch-and-scope-again/comment-page-1/#comment-243</link>
		<dc:creator>sfoster</dc:creator>
		<pubDate>Tue, 15 Jul 2008 18:47:22 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=154#comment-243</guid>
		<description>@seth - you are absolutely right, I&#039;m looking for a side-effect there which just isn&#039;t going to happen. I&#039;ll rewrite this later in the interest of accuracy (rather than revisionist history)</description>
		<content:encoded><![CDATA[<p>@seth &#8211; you are absolutely right, I&#8217;m looking for a side-effect there which just isn&#8217;t going to happen. I&#8217;ll rewrite this later in the interest of accuracy (rather than revisionist history)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: seth</title>
		<link>http://dojocampus.org/content/2008/07/15/dojohitch-and-scope-again/comment-page-1/#comment-241</link>
		<dc:creator>seth</dc:creator>
		<pubDate>Tue, 15 Jul 2008 16:29:26 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=154#comment-241</guid>
		<description>The example with init() doesn&#039;t work for me.  It always prints out the window.location:

Here&#039;s what I ran in firebug using dojo 1.0.2 off of the AOL CDN:

dojo.declare(&quot;Person&quot;, null, {
  constructor: function(name, petName) {
    this.name = name;
    this.getPrivateName = function() {
      return petName;
    }
  },
  getName: function() {
    return this.name;
  },
  getLocation: function() {
    return location;
  }
});

person1 = new Person(&quot;Mr. First Person&quot;, &quot;cuddles&quot;);

function init() {
 var location = &quot;In the init function&quot;;
 console.log(&quot;init: &quot;, location );
 window.locationGetter1 = function() { return location; };
 window.locationGetter2 = dojo.hitch(person1, person1.getLocation);
 console.log( &quot;init:&quot;, locationGetter2() );
}
init();
console.log( location );
console.log( locationGetter1() );
console.log(locationGetter2());</description>
		<content:encoded><![CDATA[<p>The example with init() doesn&#8217;t work for me.  It always prints out the window.location:</p>
<p>Here&#8217;s what I ran in firebug using dojo 1.0.2 off of the AOL CDN:</p>
<p>dojo.declare(&#8221;Person&#8221;, null, {<br />
  constructor: function(name, petName) {<br />
    this.name = name;<br />
    this.getPrivateName = function() {<br />
      return petName;<br />
    }<br />
  },<br />
  getName: function() {<br />
    return this.name;<br />
  },<br />
  getLocation: function() {<br />
    return location;<br />
  }<br />
});</p>
<p>person1 = new Person(&#8221;Mr. First Person&#8221;, &#8220;cuddles&#8221;);</p>
<p>function init() {<br />
 var location = &#8220;In the init function&#8221;;<br />
 console.log(&#8221;init: &#8220;, location );<br />
 window.locationGetter1 = function() { return location; };<br />
 window.locationGetter2 = dojo.hitch(person1, person1.getLocation);<br />
 console.log( &#8220;init:&#8221;, locationGetter2() );<br />
}<br />
init();<br />
console.log( location );<br />
console.log( locationGetter1() );<br />
console.log(locationGetter2());</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.383 seconds -->
<!-- Cached page served by WP-Cache -->
