<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>360innovate Blog &#187; mootools</title>
	<atom:link href="http://www.360innovate.co.uk/blog/tag/mootools/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.360innovate.co.uk/blog</link>
	<description></description>
	<lastBuildDate>Mon, 16 Jan 2012 15:21:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Self-executing functions in JavaScript</title>
		<link>http://www.360innovate.co.uk/blog/2010/07/self-executing-functions-in-javascript/</link>
		<comments>http://www.360innovate.co.uk/blog/2010/07/self-executing-functions-in-javascript/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 13:07:18 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[General Chat]]></category>
		<category><![CDATA[Web Development Articles]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.360innovate.co.uk/blog/?p=2155</guid>
		<description><![CDATA[In Ryan Florence&#8217;s excellent post comparing jQuery&#8217;s approach to Mootools&#8217;, he makes a number of interesting comparisons about each framework&#8217;s approach. One area where jQuery provides an elegant solution is its use of anonymous functions to set DOM properties, as shown in the following snippet. This is something that I certainly missed when working with Mootools, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2010%2F07%2Fself-executing-functions-in-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.360innovate.co.uk%2Fblog%2F2010%2F07%2Fself-executing-functions-in-javascript%2F&amp;source=360innovate&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>In Ryan Florence&#8217;s excellent post <a href="http://ryanflorence.com/jquery-1-4-mootools-1-2-compared/">comparing jQuery&#8217;s approach to Mootools&#8217;</a>, he makes a number of interesting comparisons about each framework&#8217;s approach.</p>
<p>One area where jQuery provides an elegant solution is its use of anonymous functions to set DOM properties, as shown in the following snippet.</p>
<p><iframe style="width: 100%; height: 100px" src="http://mootools.net/shell/jDJn8/embedded/"></iframe></p>
<p>This is something that I certainly missed when working with Mootools, but fortunately there&#8217;s an easy, quick solution.</p>
<p>Ryan proposes the use of the <a href="http://mootools.net/forge/p/elements_seteach">setEach plugin</a> to solve this issue, but to me, this doesn&#8217;t seem necessary. You can work around the issue by using a function that executes immediately, as follows.</p>
<p><iframe style="width: 100%; height: 150px" src="http://mootools.net/shell/mGrnf/embedded/"></iframe></p>
<p>The key here is the extra pair of parentheses after the function definition, which forces the function to execute straight away. Simple, quick, and it gives the same functionality as the jQuery equivalent without having to add the overhead of a plug in. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.360innovate.co.uk/blog/2010/07/self-executing-functions-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

