<?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:series="http://unfoldingneurons.com/"
> <channel><title>Comments on: DomReady Event Methods in JavaScript&#160;Frameworks</title> <atom:link href="http://davidwalsh.name/javascript-domready/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/javascript-domready</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Thu, 09 Feb 2012 09:28:55 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3</generator> <item><title>By: Daquan Wright</title><link>http://davidwalsh.name/javascript-domready/comment-page-1#comment-24133</link> <dc:creator>Daquan Wright</dc:creator> <pubDate>Thu, 19 May 2011 22:34:05 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4992#comment-24133</guid> <description>jQuery is the most popular because it&#039;s &quot;niche&quot; is on what matters to most people, the DOM. Because jQuery has a shorter scope, it&#039;s shorter to write and easy (many people feel it&#039;s as easy as writing CSS).MooTools is programming, like a more improved flavor of JS. Since JS is such a different language from most, people don&#039;t really want to deal with it anyway (so the easiest route is always selected).MooTools is comprehensive, and has a much steeper learning curve. Unless you were already programming, jQuery is MUCH more user-friendly.</description> <content:encoded><![CDATA[<p>jQuery is the most popular because it&#8217;s &#8220;niche&#8221; is on what matters to most people, the DOM. Because jQuery has a shorter scope, it&#8217;s shorter to write and easy (many people feel it&#8217;s as easy as writing CSS).</p><p>MooTools is programming, like a more improved flavor of JS. Since JS is such a different language from most, people don&#8217;t really want to deal with it anyway (so the easiest route is always selected).</p><p>MooTools is comprehensive, and has a much steeper learning curve. Unless you were already programming, jQuery is MUCH more user-friendly.</p> ]]></content:encoded> </item> <item><title>By: David Walsh</title><link>http://davidwalsh.name/javascript-domready/comment-page-1#comment-18351</link> <dc:creator>David Walsh</dc:creator> <pubDate>Tue, 22 Jun 2010 03:28:40 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4992#comment-18351</guid> <description>@Brian Arnold:  The extremist in me says make it &quot;dojo.r()&quot; and save more bytes. :pTru dat with addOnLoad working with required modules.  MooTools has a bundled package that can create different Moo builds depending on what is needed on a given page.</description> <content:encoded><![CDATA[<p>@Brian Arnold:  The extremist in me says make it &#8220;dojo.r()&#8221; and save more bytes. :p</p><p>Tru dat with addOnLoad working with required modules.  MooTools has a bundled package that can create different Moo builds depending on what is needed on a given page.</p> ]]></content:encoded> </item> <item><title>By: Brian Arnold</title><link>http://davidwalsh.name/javascript-domready/comment-page-1#comment-18350</link> <dc:creator>Brian Arnold</dc:creator> <pubDate>Tue, 22 Jun 2010 03:20:31 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4992#comment-18350</guid> <description>I can understand that, though one could make the argument that .ready is better, if for no other reason than saving four bytes. :)Also worth noting: addOnLoad (or ready, whichever) have more power inherently than the other libraries do -- at least, that I&#039;m aware of. For example, dojo.addOnLoad(obj, &quot;someFunc&quot;) will run obj.someFunc when the DOM is ready, or dojo.addOnLoad(obj, function () {/*...*/}) will run the anonymous function scoped to obj.I know you could accomplish the latter by doing jQuery.ready(jQuery.proxy(function () {/*...*/}, obj), when using 1.4, and I&#039;m sure other languages have similar (heck, native has bind in some newer browsers which would also do it). Still kind of a neat trick.Oh, also, addOnLoad, thanks to the require mechanics of Dojo, actually lets you do some sorts of lazy loading. You could chain things, likedojo.addOnLoad(function () {
// Bind to some button stashed in some node variable
dojo.connect(node, &#039;onclick&#039;, function (e) {
// Need something new!
dojo.require(&#039;some.other.thing&#039;);
dojo.addOnLoad(function () {
// This only runs once the required module has loaded
}); // inner addOnLoad
}); // connect
}); // outer addOnLoadWhich is also to say that technically, addOnLoad isn&#039;t listening just for DOM to be ready, but for all required modules to be loaded, no matter how nested.A bit off-topic, I suppose, but it does show that things are a bit more powerful here. I suspect jQuery/RequireJS can do similar sorts of things, but I haven&#039;t really dug into that yet.</description> <content:encoded><![CDATA[<p>I can understand that, though one could make the argument that .ready is better, if for no other reason than saving four bytes. :)</p><p>Also worth noting: addOnLoad (or ready, whichever) have more power inherently than the other libraries do &#8212; at least, that I&#8217;m aware of. For example, dojo.addOnLoad(obj, &#8220;someFunc&#8221;) will run obj.someFunc when the DOM is ready, or dojo.addOnLoad(obj, function () {/*&#8230;*/}) will run the anonymous function scoped to obj.</p><p>I know you could accomplish the latter by doing jQuery.ready(jQuery.proxy(function () {/*&#8230;*/}, obj), when using 1.4, and I&#8217;m sure other languages have similar (heck, native has bind in some newer browsers which would also do it). Still kind of a neat trick.</p><p>Oh, also, addOnLoad, thanks to the require mechanics of Dojo, actually lets you do some sorts of lazy loading. You could chain things, like</p><p>dojo.addOnLoad(function () {<br
/> // Bind to some button stashed in some node variable<br
/> dojo.connect(node, &#8216;onclick&#8217;, function (e) {<br
/> // Need something new!<br
/> dojo.require(&#8216;some.other.thing&#8217;);<br
/> dojo.addOnLoad(function () {<br
/> // This only runs once the required module has loaded<br
/> }); // inner addOnLoad<br
/> }); // connect<br
/> }); // outer addOnLoad</p><p>Which is also to say that technically, addOnLoad isn&#8217;t listening just for DOM to be ready, but for all required modules to be loaded, no matter how nested.</p><p>A bit off-topic, I suppose, but it does show that things are a bit more powerful here. I suspect jQuery/RequireJS can do similar sorts of things, but I haven&#8217;t really dug into that yet.</p> ]]></content:encoded> </item> <item><title>By: Adam Meyer</title><link>http://davidwalsh.name/javascript-domready/comment-page-1#comment-18349</link> <dc:creator>Adam Meyer</dc:creator> <pubDate>Tue, 22 Jun 2010 03:13:33 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4992#comment-18349</guid> <description>@Brian Arnold:Yeah
document.addEvent(&#039;ready&#039;, function(){})ordom.addEvent(&#039;ready&#039;, function(){})would be the only think I would possibly change</description> <content:encoded><![CDATA[<p>@Brian Arnold:</p><p>Yeah<br
/> document.addEvent(&#8216;ready&#8217;, function(){</p><p>})</p><p>or</p><p>dom.addEvent(&#8216;ready&#8217;, function(){</p><p>})</p><p>would be the only think I would possibly change</p> ]]></content:encoded> </item> <item><title>By: David Walsh</title><link>http://davidwalsh.name/javascript-domready/comment-page-1#comment-18348</link> <dc:creator>David Walsh</dc:creator> <pubDate>Tue, 22 Jun 2010 03:06:10 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4992#comment-18348</guid> <description>@Brian Arnold:  dojo.addOnLoad &gt; dojo.ready&quot;.ready&quot; is too jQuery-ish for me.</description> <content:encoded><![CDATA[<p>@Brian Arnold:  dojo.addOnLoad > dojo.ready</p><p>&#8220;.ready&#8221; is too jQuery-ish for me.</p> ]]></content:encoded> </item> <item><title>By: Brian Arnold</title><link>http://davidwalsh.name/javascript-domready/comment-page-1#comment-18347</link> <dc:creator>Brian Arnold</dc:creator> <pubDate>Tue, 22 Jun 2010 02:48:48 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4992#comment-18347</guid> <description>Oh, also meant to mention that dojo does have dojo.ready as an alias for addOnLoad as of 1.4. :)</description> <content:encoded><![CDATA[<p>Oh, also meant to mention that dojo does have dojo.ready as an alias for addOnLoad as of 1.4. :)</p> ]]></content:encoded> </item> <item><title>By: Brian Arnold</title><link>http://davidwalsh.name/javascript-domready/comment-page-1#comment-18346</link> <dc:creator>Brian Arnold</dc:creator> <pubDate>Tue, 22 Jun 2010 02:47:57 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4992#comment-18346</guid> <description>The thing I don&#039;t like about the Mootools approach is that it&#039;s on Window. Seems like document would be a more meaningful place.That being said, there&#039;s also the native approach for browsers that support it (which is to say, pretty much everything but IE these days, and likely IE9):​document.addEventListener(&#039;DOMContentLoaded&#039;, function () {
// Etc
}, false);​​​​​I love the libraries (particularly enamored with Dojo lately ;)) but it&#039;s good to know how to do it raw too. :D</description> <content:encoded><![CDATA[<p>The thing I don&#8217;t like about the Mootools approach is that it&#8217;s on Window. Seems like document would be a more meaningful place.</p><p>That being said, there&#8217;s also the native approach for browsers that support it (which is to say, pretty much everything but IE these days, and likely IE9):</p><p>​document.addEventListener(&#8216;DOMContentLoaded&#8217;, function () {<br
/> // Etc<br
/> }, false);​​​​​</p><p>I love the libraries (particularly enamored with Dojo lately ;)) but it&#8217;s good to know how to do it raw too. :D</p> ]]></content:encoded> </item> <item><title>By: Mark</title><link>http://davidwalsh.name/javascript-domready/comment-page-1#comment-18344</link> <dc:creator>Mark</dc:creator> <pubDate>Tue, 22 Jun 2010 00:32:55 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4992#comment-18344</guid> <description>To add on, jQuery has several other variations to fire a DOM ready f&#039;n:1.
$(function(){
// $ code here
});If $ has been released to the global namespace then this also works:2.
jQuery(function($){
// you can now use $ here
});</description> <content:encoded><![CDATA[<p>To add on, jQuery has several other variations to fire a DOM ready f&#8217;n:</p><p>1.<br
/> $(function(){<br
/> // $ code here<br
/> });</p><p>If $ has been released to the global namespace then this also works:</p><p>2.<br
/> jQuery(function($){<br
/> // you can now use $ here<br
/> });</p> ]]></content:encoded> </item> <item><title>By: Alex</title><link>http://davidwalsh.name/javascript-domready/comment-page-1#comment-18343</link> <dc:creator>Alex</dc:creator> <pubDate>Mon, 21 Jun 2010 22:05:55 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4992#comment-18343</guid> <description>@Jani Peltoniemi
I damn (totally^totally*+∞)&gt;100% agree with you! Mootools syntax rocks so much that I don&#039;t even dare to imagine myself using any other!@Allen
YUI is the main reason I have delayed the creation of my first vBulletin4/Mootools style (template). Not only its syntax, pardon me, sucks, but it conflicts with other js frameworks. BTW, If I need to use a framework, I shall use only one. The one that is synonymous of FTW!!!</description> <content:encoded><![CDATA[<p>@Jani Peltoniemi<br
/> I damn (totally^totally*+∞)&gt;100% agree with you! Mootools syntax rocks so much that I don&#8217;t even dare to imagine myself using any other!</p><p>@Allen<br
/> YUI is the main reason I have delayed the creation of my first vBulletin4/Mootools style (template). Not only its syntax, pardon me, sucks, but it conflicts with other js frameworks. BTW, If I need to use a framework, I shall use only one. The one that is synonymous of FTW!!!</p> ]]></content:encoded> </item> <item><title>By: jem</title><link>http://davidwalsh.name/javascript-domready/comment-page-1#comment-18342</link> <dc:creator>jem</dc:creator> <pubDate>Mon, 21 Jun 2010 22:01:07 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4992#comment-18342</guid> <description>I prefer the mootools approach myself. And I agree, the YUI code looks way too verbose, if the rest of the framework&#039;s API translates to code like that then there&#039;s reason in itself to avoid it.Mootools code has a tendency of looking cleaner in general to me (prototype is similar but it has very wordy method names), which I think is largely due to the fact it takes the approach of prototyping and extending native objects.</description> <content:encoded><![CDATA[<p>I prefer the mootools approach myself. And I agree, the YUI code looks way too verbose, if the rest of the framework&#8217;s API translates to code like that then there&#8217;s reason in itself to avoid it.</p><p>Mootools code has a tendency of looking cleaner in general to me (prototype is similar but it has very wordy method names), which I think is largely due to the fact it takes the approach of prototyping and extending native objects.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 1/18 queries in 0.023 seconds using disk: basic
Object Caching 865/868 objects using disk: basic

Served from: davidwalsh.name @ 2012-02-09 04:45:18 -->
