<?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: Cleaning your markup with dojo.behavior</title>
	<atom:link href="http://dojocampus.org/content/2008/03/26/cleaning-your-markup-with-dojobehavior/feed/" rel="self" type="application/rss+xml" />
	<link>http://dojocampus.org/content/2008/03/26/cleaning-your-markup-with-dojobehavior/</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: SitePen Blog &#187; Simplifying Maintenance With Event Driven Design</title>
		<link>http://dojocampus.org/content/2008/03/26/cleaning-your-markup-with-dojobehavior/comment-page-1/#comment-321</link>
		<dc:creator>SitePen Blog &#187; Simplifying Maintenance With Event Driven Design</dc:creator>
		<pubDate>Tue, 03 Mar 2009 08:04:16 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=90#comment-321</guid>
		<description>[...] been using dojo.behavior (see also here) quite a bit lately. As I mentioned in the post introducing Queued, we used it for [...]</description>
		<content:encoded><![CDATA[<p>[...] been using dojo.behavior (see also here) quite a bit lately. As I mentioned in the post introducing Queued, we used it for [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pottedmeat</title>
		<link>http://dojocampus.org/content/2008/03/26/cleaning-your-markup-with-dojobehavior/comment-page-1/#comment-121</link>
		<dc:creator>pottedmeat</dc:creator>
		<pubDate>Thu, 24 Apr 2008 12:49:28 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=90#comment-121</guid>
		<description>@Seth, there&#039;s a major difference. dojo.behavior manages the application of the behaviors.

So if you add a node to the document, then use apply, it won&#039;t re-apply the behavior to nodes that have already been matched.</description>
		<content:encoded><![CDATA[<p>@Seth, there&#8217;s a major difference. dojo.behavior manages the application of the behaviors.</p>
<p>So if you add a node to the document, then use apply, it won&#8217;t re-apply the behavior to nodes that have already been matched.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: seth</title>
		<link>http://dojocampus.org/content/2008/03/26/cleaning-your-markup-with-dojobehavior/comment-page-1/#comment-66</link>
		<dc:creator>seth</dc:creator>
		<pubDate>Fri, 28 Mar 2008 22:55:36 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=90#comment-66</guid>
		<description>strange...it doesn&#039;t work for me on FF2/Ubuntu 7.10 (unless my focus is in a text box or text area).  when I add a found event, it finds it.

&gt;&gt; dojo.require(&quot;dojo.behavior&quot;);
&gt;&gt; dojo.behavior.add({ &#039;body&#039; : { found: function(e) { console.debug(e); }, onkeypress:function(e) { console.debug(&#039;o hai&#039;, e); } } });
&gt;&gt; dojo.behavior.apply();

Thanks for the reply....</description>
		<content:encoded><![CDATA[<p>strange&#8230;it doesn&#8217;t work for me on FF2/Ubuntu 7.10 (unless my focus is in a text box or text area).  when I add a found event, it finds it.</p>
<p>&gt;&gt; dojo.require(&#8221;dojo.behavior&#8221;);<br />
&gt;&gt; dojo.behavior.add({ &#8216;body&#8217; : { found: function(e) { console.debug(e); }, onkeypress:function(e) { console.debug(&#8217;o hai&#8217;, e); } } });<br />
&gt;&gt; dojo.behavior.apply();</p>
<p>Thanks for the reply&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Coup</title>
		<link>http://dojocampus.org/content/2008/03/26/cleaning-your-markup-with-dojobehavior/comment-page-1/#comment-65</link>
		<dc:creator>Robert Coup</dc:creator>
		<pubDate>Fri, 28 Mar 2008 21:32:31 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=90#comment-65</guid>
		<description>Hi Seth,

Adding behaviours to body seems to work for me - dojo.behavior applies its queries to the document so everything should fall into its scope.

&gt; dojo.behavior.add({ &#039;body&#039; : { onkeypress:function(e) { console.debug(&#039;o hai&#039;, e); } } });
&gt; dojo.behavior.apply();

In FF2/OSX keys pressed with no element focussed ran the auto-search functionality instead, but it worked fine in a textarea on the page.

- Rob :)</description>
		<content:encoded><![CDATA[<p>Hi Seth,</p>
<p>Adding behaviours to body seems to work for me &#8211; dojo.behavior applies its queries to the document so everything should fall into its scope.</p>
<p>> dojo.behavior.add({ &#8216;body&#8217; : { onkeypress:function(e) { console.debug(&#8217;o hai&#8217;, e); } } });<br />
> dojo.behavior.apply();</p>
<p>In FF2/OSX keys pressed with no element focussed ran the auto-search functionality instead, but it worked fine in a textarea on the page.</p>
<p>- Rob <img src='http://dojocampus.org/content/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: seth</title>
		<link>http://dojocampus.org/content/2008/03/26/cleaning-your-markup-with-dojobehavior/comment-page-1/#comment-64</link>
		<dc:creator>seth</dc:creator>
		<pubDate>Fri, 28 Mar 2008 18:09:36 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=90#comment-64</guid>
		<description>Speaking of doing it wrong, I had buggy code....should have been *document.getElementsByTagName(&quot;body&quot;)*

Now it behaves the same as dojo.behavior.  Anyway to use dojo.behavior so it binds to the whole page? :)</description>
		<content:encoded><![CDATA[<p>Speaking of doing it wrong, I had buggy code&#8230;.should have been *document.getElementsByTagName(&#8221;body&#8221;)*</p>
<p>Now it behaves the same as dojo.behavior.  Anyway to use dojo.behavior so it binds to the whole page? <img src='http://dojocampus.org/content/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: seth</title>
		<link>http://dojocampus.org/content/2008/03/26/cleaning-your-markup-with-dojobehavior/comment-page-1/#comment-63</link>
		<dc:creator>seth</dc:creator>
		<pubDate>Fri, 28 Mar 2008 00:17:10 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=90#comment-63</guid>
		<description>So, I gave dojo.behavior a whirl.  I tried to set up a keyboard command to make something happen, so I did this:

dojo.require(&quot;dojo.behavior&quot;);
dojo.behavior.add( {
body: { 
   onkeypress: function(evt) { console.log(&quot;ur doin it wrong&quot;) }
    }
});
dojo.behavior.apply();

That didn&#039;t do anything unless I click in a text box and start typing. I expteced the event to fire if I clicked anywhere on hit the keyboard command.

Yet, when I do this:
dojo.connect(document.getElementsByName(&quot;body&quot;)[0],
    &quot;onkeypress&quot;,
     function(evt) {
        console.log(&quot;o hai!&quot;);
     }
);

and click anywhere on the page (like on an empty div) and start typing, it&#039;ll output &#039;o hai&#039;

I realize this might not be the place to post this but I figured I&#039;d stop here before I dove into the forums.

Thanks in advance.</description>
		<content:encoded><![CDATA[<p>So, I gave dojo.behavior a whirl.  I tried to set up a keyboard command to make something happen, so I did this:</p>
<p>dojo.require(&#8221;dojo.behavior&#8221;);<br />
dojo.behavior.add( {<br />
body: {<br />
   onkeypress: function(evt) { console.log(&#8221;ur doin it wrong&#8221;) }<br />
    }<br />
});<br />
dojo.behavior.apply();</p>
<p>That didn&#8217;t do anything unless I click in a text box and start typing. I expteced the event to fire if I clicked anywhere on hit the keyboard command.</p>
<p>Yet, when I do this:<br />
dojo.connect(document.getElementsByName(&#8221;body&#8221;)[0],<br />
    &#8220;onkeypress&#8221;,<br />
     function(evt) {<br />
        console.log(&#8221;o hai!&#8221;);<br />
     }<br />
);</p>
<p>and click anywhere on the page (like on an empty div) and start typing, it&#8217;ll output &#8216;o hai&#8217;</p>
<p>I realize this might not be the place to post this but I figured I&#8217;d stop here before I dove into the forums.</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Coup</title>
		<link>http://dojocampus.org/content/2008/03/26/cleaning-your-markup-with-dojobehavior/comment-page-1/#comment-61</link>
		<dc:creator>Robert Coup</dc:creator>
		<pubDate>Thu, 27 Mar 2008 04:35:07 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=90#comment-61</guid>
		<description>Hi Seth,

Thanks!

There&#039;s no technical difference between them. It really appeals to me because it&#039;s clean - at a glance i can see what behaviours are applying to which nodes - no addOnLoad() blocks full of repeated calls to dojo.query(). In one app we have several modules that might combine on a page - each has a behaviours section with a call to dojo.behavior.add() in it - you know where to look, and its not mixed up with other onLoad code.

Rob :)</description>
		<content:encoded><![CDATA[<p>Hi Seth,</p>
<p>Thanks!</p>
<p>There&#8217;s no technical difference between them. It really appeals to me because it&#8217;s clean &#8211; at a glance i can see what behaviours are applying to which nodes &#8211; no addOnLoad() blocks full of repeated calls to dojo.query(). In one app we have several modules that might combine on a page &#8211; each has a behaviours section with a call to dojo.behavior.add() in it &#8211; you know where to look, and its not mixed up with other onLoad code.</p>
<p>Rob <img src='http://dojocampus.org/content/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: seth</title>
		<link>http://dojocampus.org/content/2008/03/26/cleaning-your-markup-with-dojobehavior/comment-page-1/#comment-60</link>
		<dc:creator>seth</dc:creator>
		<pubDate>Thu, 27 Mar 2008 03:24:36 +0000</pubDate>
		<guid isPermaLink="false">http://dojocampus.org/content/?p=90#comment-60</guid>
		<description>Nice article.  

What are the advantages of using dojo.behavior, vs. dojo.query.connect or dojo.connect?  Centralized location of code?</description>
		<content:encoded><![CDATA[<p>Nice article.  </p>
<p>What are the advantages of using dojo.behavior, vs. dojo.query.connect or dojo.connect?  Centralized location of code?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.425 seconds -->
