<?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>Transcending Frontiers &#187; Keeping Context in Your AJAX Callbacks</title>
	<atom:link href="http://blog.thefrontiergroup.com.au/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thefrontiergroup.com.au</link>
	<description>Your peek inside the collective mind of The Frontier Group</description>
	<lastBuildDate>Mon, 02 Apr 2012 04:32:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Keeping Context in Your AJAX Callbacks</title>
		<link>http://blog.thefrontiergroup.com.au/2009/03/keeping-context-in-your-ajax-callbacks/</link>
		<comments>http://blog.thefrontiergroup.com.au/2009/03/keeping-context-in-your-ajax-callbacks/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 08:19:04 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JSON]]></category>

		<guid isPermaLink="false">http://thefrontiergroup.com.au/blog/?p=356</guid>
		<description><![CDATA[These days I&#8217;m using a lot of asynchronous calls to get data and dynamically build the UI on the client side. It generally allows a far nicer experience to be provided to the user, being able to update parts of the UI without reloading the whole page is one of the first steps to your [...]]]></description>
			<content:encoded><![CDATA[<p>These days I&#8217;m using a lot of asynchronous calls to get data and dynamically build the UI on the client side. It generally allows a far nicer experience to be provided to the user, being able to update parts of the UI without reloading the whole page is one of the first steps to your apps being able to wear a Web 2.0 moniker. </p>
<p>The general pattern for me these days has become : </p>
<pre class="javascript" name="code">
var callback = function CallBack(data) {
    ... Do Some Processing ....
}

var input_data = GatherData();
MakeRequest(target_url, data, callback);
</pre>
<p>I tend to use jQuery and so my callback is passed in the returned data from the target_url. My call back function then generally performs some tasks on the UI based on what it receives.</p>
<p>The problem though is that in this pattern you can&#8217;t get any data from the context when <code>MakeRequest()</code> is called into the scope of <code>CallBack</code>. It&#8217;s a scoping issue that falls outside of this little post, but if you&#8217;d like an explanation of how Javascript handles scope of variables then you can Google for Javascript scope chain or take a shortcut to <a href="http://www.digital-web.com/articles/scope_in_javascript/">this article</a>. Essentially when the call is made to <code>CallBack()</code> all it will have is it&#8217;s own variables and any globally accessible (window) variables. </p>
<p>This week though I had a thought and worked through it with one of my work mates, Tony. If you passed in a function that had the scope that included the context you wanted to pass, then maybe you&#8217;d be able to access whatever data from the callee you wanted. It turns out that this does work. </p>
<p>The way to do this is pretty simple, and I used it to create a simple function that would grab data and then populate a select element with options. In this case the context I&#8217;d like to keep is which select element is the target. </p>
<p>Say that I needed to run this over a bunch of select elements in quick succession then as the callbacks were issued they may end up out of the initial execution order, so the target element isn&#8217;t reliable if it&#8217;s been stored in a global variable. I could pass it in as a variable that would come back from the page that is returning the data but that just <a href="http://en.wikipedia.org/wiki/Code_smell">smells bad</a> to me. I think potentially JSONP is an alternative too, but this felt like the right way. </p>
<pre class="javascript" name="code">
$.getJSON(url, input_data,
	(function(target_element) {
		return function(response_data) {
			var html = [];

			for (var i = 0; i < response_data.length; i++) {
				item = response_data[i];

				html.push('
<option value="' + item['key'] + '">' + item['value'] + '</option>

');
			}

			target_element.children(':gt(0)').remove();
			target_element.append(html.join(''));
		};
	})(target_element)
);
</pre>
<p>Essentially the main thing that has changed is that we are now running an anonymous function at the time that the AJAX call is issued. This anonymous function itself returns a function that matches the signature that jQuery is expecting for the callback function. The scope in which this function runs contains the target_element because it was passed into the anonymous function as a parameter. I&#8217;m tempted to say that it&#8217;s all crazy Javascript scoping, but in reality it&#8217;s very cool and very powerful. </p>
<p>If you want to see the execution order of this then just put a some logging into the anonymous function and the callback function and you&#8217;ll see what I mean. It will probably make it easier to see what is going on too.</p>
<p>I&#8217;ve run into issues trying to get around these problems before and thankfully as mine and the team&#8217;s knowledge of Javascript increases I&#8217;m finding better and better solutions. I thought my previous method of approaching this problem was quite hacky but now I don&#8217;t feel so dirty. </p>
<p>Thanks to Tony too for working through this with me! </p>
<script src="http://feeds.feedburner.com/~s/TranscendingFrontiers?i=http://blog.thefrontiergroup.com.au/2009/03/keeping-context-in-your-ajax-callbacks/" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://blog.thefrontiergroup.com.au/2009/03/keeping-context-in-your-ajax-callbacks/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>An Interactive Image Without Flash</title>
		<link>http://blog.thefrontiergroup.com.au/2009/01/an-interactive-image-without-flash/</link>
		<comments>http://blog.thefrontiergroup.com.au/2009/01/an-interactive-image-without-flash/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 03:17:47 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Interactive]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://thefrontiergroup.com.au/blog/?p=320</guid>
		<description><![CDATA[I thought I&#8217;d just bring peoples&#8217; attention to this awesome demonstration of what you can achieve without the use of a technology such as flash. It&#8217;s an interactive map of the marine related sites and businesses in North Carolina. The map is implemented using jQuery and seems to pull the content for the clickable items [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I&#8217;d just bring peoples&#8217; attention to this awesome demonstration of what you can achieve without the use of a technology such as flash. It&#8217;s an <a href="http://ncmarinescience.com/">interactive map</a> of the marine related sites and businesses in North Carolina. </p>
<p>The map is implemented using jQuery and seems to pull the content for the clickable items in the map from pages within the existing CMS. This allows the content management team to update information for the map without having to know a bit of Javascript or programming in general. </p>
<p>The <a href="http://www.newmediacampaigns.com/page/jquery-vs-flash-for-interactive-map">tutorial</a> that I found this demonstration through goes into the nitty gritty of how this map was implemented.</p>
<script src="http://feeds.feedburner.com/~s/TranscendingFrontiers?i=http://blog.thefrontiergroup.com.au/2009/01/an-interactive-image-without-flash/" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://blog.thefrontiergroup.com.au/2009/01/an-interactive-image-without-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sexy Curls jQuery Plugin</title>
		<link>http://blog.thefrontiergroup.com.au/2009/01/sexy-curls-jquery-plugin/</link>
		<comments>http://blog.thefrontiergroup.com.au/2009/01/sexy-curls-jquery-plugin/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 23:50:57 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Websites or Tools]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Plugin]]></category>

		<guid isPermaLink="false">http://thefrontiergroup.com.au/blog/?p=293</guid>
		<description><![CDATA[I don&#8217;t know how to describe this plugin any better than in the title. It&#8217;s sexy, it makes the page curl, and it&#8217;s a jQuery plugin. I see potential uses in a lot of places, but as the author says he doesn&#8217;t want it to be that &#8220;&#8230;next annoying Javascript thing&#8230;&#8221;. I agree. jQuery Sexy [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know how to describe this plugin any better than in the title. It&#8217;s sexy, it makes the page curl, and it&#8217;s a jQuery plugin. I see potential uses in a lot of places, but as the author says he doesn&#8217;t want it to be that &#8220;&#8230;next annoying Javascript thing&#8230;&#8221;. I agree. <a href="http://www.elliottkember.com/sexy_curls.html">jQuery Sexy Curls</a> has the potential to make particular pages and parts of applications jump, but other than that I don&#8217;t see it taking over the world or anything. </p>
<p>Essentially it gives you a curl in the corner of your page that can be dragged back to reveal another &#8216;page&#8217; underneath. In the author&#8217;s example the under-page is the HTML code for the example.</p>
<script src="http://feeds.feedburner.com/~s/TranscendingFrontiers?i=http://blog.thefrontiergroup.com.au/2009/01/sexy-curls-jquery-plugin/" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://blog.thefrontiergroup.com.au/2009/01/sexy-curls-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery Firebug Plugin</title>
		<link>http://blog.thefrontiergroup.com.au/2009/01/jquery-firebug-plugin/</link>
		<comments>http://blog.thefrontiergroup.com.au/2009/01/jquery-firebug-plugin/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 00:45:30 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Websites or Tools]]></category>
		<category><![CDATA[Firebug]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://thefrontiergroup.com.au/blog/?p=280</guid>
		<description><![CDATA[Debugging most things that include a jQuery chain can be annoying at best and virtually impossible at worst. Now there is a jQuery Firebug Plugin that helps when debugging Javascript that uses jQuery and it seems to do it very well! The plugin allows you to call debug(), assert(), log() or any other Firebug 1.2 [...]]]></description>
			<content:encoded><![CDATA[<p>Debugging most things that include a jQuery chain can be annoying at best and virtually impossible at worst. Now there is a <a href="http://jasonkarns.com/blog/?p=5">jQuery Firebug Plugin</a> that helps when debugging Javascript that uses jQuery and it seems to do it very well! The plugin allows you to call <code>debug()</code>, <code>assert()</code>, <code>log()</code> or any other Firebug 1.2 call at any point in your chain. Fantastic!. </p>
<p>There are examples in the article of how to use <code>jQuery.Firebug()</code> so I suggest taking a peak.</p>
<script src="http://feeds.feedburner.com/~s/TranscendingFrontiers?i=http://blog.thefrontiergroup.com.au/2009/01/jquery-firebug-plugin/" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://blog.thefrontiergroup.com.au/2009/01/jquery-firebug-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>25 Tips for Better jQuery</title>
		<link>http://blog.thefrontiergroup.com.au/2008/12/25-tips-for-better-jquery/</link>
		<comments>http://blog.thefrontiergroup.com.au/2008/12/25-tips-for-better-jquery/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 01:39:20 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Websites or Tools]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://thefrontiergroup.com.au/blog/?p=254</guid>
		<description><![CDATA[Typically these types of &#8220;25 Tips To&#8230;&#8221; or &#8220;10 Things That&#8230;&#8221; style articles have a few good points but are filled with fluff. However the article 25 Tips for Better jQuery is full of great points that cover architecture, coding conventions, compatibility and performance. If you are looking to get a better handle on jQuery [...]]]></description>
			<content:encoded><![CDATA[<p>Typically these types of &#8220;25 Tips To&#8230;&#8221; or &#8220;10 Things That&#8230;&#8221; style articles have a few good points but are filled with fluff. However the article <a href="http://www.tvidesign.co.uk/blog/improve-your-jquery-25-excellent-tips.aspx">25 Tips for Better jQuery</a> is full of great points that cover architecture, coding conventions, compatibility and performance.</p>
<p>If you are looking to get a better handle on jQuery and more importantly how to use it well, I haven&#8217;t seen many better places to start.</p>
<script src="http://feeds.feedburner.com/~s/TranscendingFrontiers?i=http://blog.thefrontiergroup.com.au/2008/12/25-tips-for-better-jquery/" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://blog.thefrontiergroup.com.au/2008/12/25-tips-for-better-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handling Permissions for AJAX Requests</title>
		<link>http://blog.thefrontiergroup.com.au/2008/12/handling-permissions-for-ajax-requests/</link>
		<comments>http://blog.thefrontiergroup.com.au/2008/12/handling-permissions-for-ajax-requests/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 11:10:12 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://thefrontiergroup.com.au/blog/?p=248</guid>
		<description><![CDATA[Again I have a website where a lot of data transfer is done asynchronously and a large amount of the presentation is done using Javascript. Different users have different access to features across the site, and I can&#8217;t just rely on hiding links given the data is a simple HTTP request away. Protecting this data [...]]]></description>
			<content:encoded><![CDATA[<p>Again I have a website where a lot of data transfer is done asynchronously and a large amount of the presentation is done using Javascript. Different users have different access to features across the site, and I can&#8217;t just rely on hiding links given the data is a simple HTTP request away. Protecting this data on the server side has always been easy to me, but I&#8217;ve typically found building the persistent abstractions I like to have far more difficult on the client side. As per usual, it&#8217;s probably just another issue I haven&#8217;t spent enough time to get a grip on. </p>
<p>It&#8217;s possible technologies such as Prism and Gears will help with this in the future. Unfortunately, it is the present.</p>
<p>This time I think I have a solution that I&#8217;m pretty happy with though. On the server side it involves using the existing HTTP response codes to indicate to the requester what happened with their request. On the client side the <code>ajaxComplete()</code> event is used to handle these codes. </p>
<p>jQuery will automatically call the function you specify as your callback in an AJAX request if the request is successful, so I&#8217;m only interested in handling failures. At the moment I&#8217;m assuming that all of my calls use JSON for their data format, but the alternative is a case I can handle later if need be. Only do what is necessary right now is a great credo I think.</p>
<p>So here is my event handler, it&#8217;s very simple but the documentation on the arguments to the event are a little slight. The <code>success()</code> call just makes a call to the function specified in the original call, hence passing in an empty array, simulating no records returned. The code I&#8217;m handling is for 401: Unauthorized, which in this case is the truth. This code will be sent back when I determine that the user is trying to access some data they aren&#8217;t supposed to. <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP codes</a> handle the majority of cases you&#8217;ll run into.</p>
<pre name="code" class="javascript">
(function() {
	if (typeof(jQuery) != 'undefined') {
		jQuery().ajaxComplete(function(ev, req, settings) {
			if (req.status == 401) {
				settings.success([]);
				alert('You have insufficient privileges.');
			}
		});
	}
})();
</pre>
<p>The server side code is simple, it&#8217;s just a matter of sending back the appropriate <a href="http://php.net/header">header</a>:</p>
<pre name="code" class="php">
	header('HTTP/1.0 401 Insufficient Privileges', false, 401);
</pre>
<p>This function is specified in a global include where part of the website uses prototype, I&#8217;ve been slowly integrating jQuery. Therefore the first thing I do is check if jQuery has been defined, if it has then I register my function as the handler for the <code>ajaxComplete</code> event. Since it&#8217;s declared globally this will happen on every AJAX call. If the response code is 401 then first I pass back and empty array to my <code>success</code> handler so that the little loading notifier disappears, and then I notify the user of the error. </p>
<p>It seems to be a trend lately, but again this is just a very simple idea but I hope it saves someone some hassle. I know I&#8217;ve searched high and low on the topic and haven&#8217;t found a nice generic solution. </p>
<script src="http://feeds.feedburner.com/~s/TranscendingFrontiers?i=http://blog.thefrontiergroup.com.au/2008/12/handling-permissions-for-ajax-requests/" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://blog.thefrontiergroup.com.au/2008/12/handling-permissions-for-ajax-requests/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Animating Table Rows with jQuery</title>
		<link>http://blog.thefrontiergroup.com.au/2008/12/animating-table-rows-with-jquery/</link>
		<comments>http://blog.thefrontiergroup.com.au/2008/12/animating-table-rows-with-jquery/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 13:55:19 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[AuroraCMS]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Product Reviews]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://thefrontiergroup.com.au/blog/?p=220</guid>
		<description><![CDATA[Animating table rows in the browser is problematic. You see, they aren&#8217;t block elements and as such don&#8217;t have a height or width property. Instead they take their constraints from the content inside them, and the elements that contain them. For rows this typically means they&#8217;re constrained by the containing table, and filled by the [...]]]></description>
			<content:encoded><![CDATA[<p>Animating table rows in the browser is problematic. You see, they aren&#8217;t block elements and as such don&#8217;t have a height or width property. Instead they take their constraints from the content inside them, and the elements that contain them. For rows this typically means they&#8217;re constrained by the containing table, and filled by the contained columns.</p>
<p>Today I wanted to slide a row up, and then when it had finished sliding I wanted to remove it from the DOM. Essentially giving it a nice effect when something is deleted.</p>
<p>Given that the height of a row is controlled by it&#8217;s content, I figured the easiest way to do this would be to wrap all of the content inside each column with a block element, in this case a <code>div</code>, and then resize those.</p>
<p>jQuery makes this extremely easy :</p>
<pre name="code" class="javascript">var el = $(options.element_prefix + id);
el.children("td").each(function() {
    $(this).wrapInner("< div />").children("div").slideUp(function() {el.remove();})
});</pre>
<p>NOTE : The div tag in the <code>wrapInner()</code> is malformed because it won&#8217;t display properly otherwise. Please remove the space between the opening bracket and &#8216;div&#8217;. </p>
<p>It&#8217;s all pretty easy to understand. Essentially my root element is a row, and so for each <code>td</code> in that row wrap it&#8217;s content in a <code>div</code>. Then for the child <code>divs</code> in each <code>td</code>, run the <code>slideUp()</code> method. The callback in the <code>slideUp()</code> method says after the animation is done, remove the row. Given the speed of computers these days, no one will notice that the last few columns quite likely just vanish instead of complete their animation.</p>
<script src="http://feeds.feedburner.com/~s/TranscendingFrontiers?i=http://blog.thefrontiergroup.com.au/2008/12/animating-table-rows-with-jquery/" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://blog.thefrontiergroup.com.au/2008/12/animating-table-rows-with-jquery/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Rails Rumble Follow Up</title>
		<link>http://blog.thefrontiergroup.com.au/2008/12/rails-rumble-follow-up/</link>
		<comments>http://blog.thefrontiergroup.com.au/2008/12/rails-rumble-follow-up/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 01:56:01 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Industry Trends]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rails Rumble]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://thefrontiergroup.com.au/blog/?p=193</guid>
		<description><![CDATA[I&#8217;ve written about Rails Rumble previously, the 48 hour event where teams turn an idea into a web application using Ruby on Rails. I was surprised to see the completeness of some of the applications that were developed this year as well as the utility of the ideas they implemented. One of the more interesting [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written about Rails Rumble <a href="http://thefrontiergroup.com.au/blog/2008/10/what-can-you-make-in-48-hours/">previously</a>, the 48 hour event where teams turn an idea into a web application using Ruby on Rails. I was surprised to see the completeness of some of the applications that were developed this year as well as the utility of the ideas they implemented.</p>
<p style="text-align: left;">One of the more interesting <a href="http://www.rubyrailways.com/rails-rumble-observations-part-ii-trends-in-gemplugin-usage/">articles</a> I&#8217;ve seen in relation to Rails Rumble analysed the prevalence of various plug-ins and gems that teams utilised.</p>
<p>After a quick look there are a few points that specifically interest me :</p>
<ul>
<li>jQuery is the most used Javascript library, even though it isn&#8217;t the default included with Rails. I think this says a lot about where jQuery fits in the client side coding space these days. Under further scrutiny it seems clear that jQuery had an even larger base of use than shown in that graph, as explained <a href="http://www.rubyrailways.com/rails-rumble-observations-part-i-jquery-on-the-heels-of-prototype/">here</a>.</li>
<li>1 in 3 teams used a skeleton application. All of those teams used Bort. That&#8217;s a pretty overwhelming statistic for two reasons. Firstly it means you should be looking at using skeleton applications if you aren&#8217;t already. Secondly anything that you develop that could be used in other applications should possibly be a gem or plug-in. Reuse doesn&#8217;t seem to be something you just talk about anymore.</li>
<li>Over 50% of people wrote tests as part of their application, and the majority of people used a <a href="http://en.wikipedia.org/wiki/Behavior_driven_development">Behaviour Driven Development</a> framework such as Shoulda or rSpec (<a href="http://www.railsenvy.com/2008/7/17/we-aint-got-no-rspec">they got rSpec!</a>). Keep in mind that even on a tight schedule most people using Rails are writing tests!</li>
<li>Over a third of applications offered OpenID support for authentication. Given I don&#8217;t even remember where I signed up for OpenID this surprises me. Maybe it&#8217;s time to join this bandwagon?</li>
</ul>
<p>I think the article gives a good indicator where you should look to implement certain parts of your application. Generally speaking, if a lot of passionate developers are using a particular library or piece of code then you&#8217;d be wise to make the same choice.</p>
<script src="http://feeds.feedburner.com/~s/TranscendingFrontiers?i=http://blog.thefrontiergroup.com.au/2008/12/rails-rumble-follow-up/" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://blog.thefrontiergroup.com.au/2008/12/rails-rumble-follow-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery: Check For Non-Empty Input Fields</title>
		<link>http://blog.thefrontiergroup.com.au/2008/11/jquery-check-for-non-empty-input-fields/</link>
		<comments>http://blog.thefrontiergroup.com.au/2008/11/jquery-check-for-non-empty-input-fields/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 08:46:07 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://thefrontiergroup.com.au/blog/?p=176</guid>
		<description><![CDATA[&#8211; Check out some of our more recent Ruby on Rails blog posts. If you&#8217;d like to hire our team, get in touch &#8211; I was writing some code today and I wanted to prompt the user to check if they wanted to delete a row of data only if there was some data they [...]]]></description>
			<content:encoded><![CDATA[<p><em>&#8211; Check out some of our more recent </em><a title="Ruby on Rails posts" href="http://thefrontiergroup.com.au/blog/category/ruby-on-rails/"><em>Ruby on Rails blog posts</em></a><em>. If you&#8217;d like to hire our team, <a title="Get in touch" href="http://thefrontiergroup.com.au/pages/contact-us">get in touch</a></em><em> &#8211;</em></p>
<p>I was writing some code today and I wanted to prompt the user to check if they wanted to delete a row of data only if there was some data they might not want deleted. Typically to do this I would loop through all the input fields and if any of them weren&#8217;t blank I would run the check. I figured that there must be a better way with callbacks or selectors, and after a little thinking I wrote this jQuery snippet :</p>
<pre class="javascript">row.find('input[value!=""]').length &gt; 0</pre>
<p>This basically says count the number of inputs with a non-blank value you find, inside the given row.</p>
<p>Just like <a href="http://thefrontiergroup.com.au/blog/2008/11/dynamically-reducing-object-sizes-in-php/">my last post</a>, it&#8217;s nothing amazing but it sure is a better way of doing things. If you look into the <code>andSelf()</code> method then you could also easily chain selects and other input types.</p>
<p>I&#8217;m also interested if someone has a better way to approach this problem?</p>
<script src="http://feeds.feedburner.com/~s/TranscendingFrontiers?i=http://blog.thefrontiergroup.com.au/2008/11/jquery-check-for-non-empty-input-fields/" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://blog.thefrontiergroup.com.au/2008/11/jquery-check-for-non-empty-input-fields/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>MochiKit 1.4 is Released</title>
		<link>http://blog.thefrontiergroup.com.au/2008/10/mochikit_14_release/</link>
		<comments>http://blog.thefrontiergroup.com.au/2008/10/mochikit_14_release/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 01:48:49 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Websites or Tools]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[John Resig]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MochiKit]]></category>

		<guid isPermaLink="false">http://thefrontiergroup.com.au/blog/?p=107</guid>
		<description><![CDATA[I&#8217;m a big fan of Javascript frameworks that help me get things done, I&#8217;m a huge fan of anything that helps me get things done easier. My favourite framework though is jQuery after having tried a few just over a year ago I settled on jQuery as a better choice than Prototype and thankfully I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a big fan of Javascript frameworks that help me get things done, I&#8217;m a huge fan of anything that helps me get things done easier. My favourite framework though is <a href="http://jquery.com">jQuery</a> after having tried a few just over a year ago I settled on jQuery as a better choice than Prototype and thankfully I&#8217;ve been proven right.</p>
<p>John Resig, the creator of jQuery is also a bit of a proponent for another framework called <a href="http://mochikit.com">MochiKit</a>. The idea of MochiKit is to &#8220;Make Javascript Suck Less&#8221; and as such doesn&#8217;t really offer many out there features that others might, it more concentrates on filling in functionality gaps that are present in the Javascript language.</p>
<p>These things include better comparator functions, which enable sorting and so on, also there are handy formatting functions, asynchronous functions and data functions for handling JSON. DOM manipulation looks to be very good, though whether it&#8217;s easier than jQuery is probably up to personal choice. Basically MochiKit seems to fill in the gaps of Javascript and do exactly what it says it does, make programming with Javascript suck less by giving you the functions you always wished you had.</p>
<p>I plan on checking this out and feel like it&#8217;s probably a worth addition to anybodys&#8217; toolbox that is writing client side code.</p>
<script src="http://feeds.feedburner.com/~s/TranscendingFrontiers?i=http://blog.thefrontiergroup.com.au/2008/10/mochikit_14_release/" type="text/javascript" charset="utf-8"></script>]]></content:encoded>
			<wfw:commentRss>http://blog.thefrontiergroup.com.au/2008/10/mochikit_14_release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

