<?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>Cake Solutions Team Blog &#187; Andrew C&#8217;s Blog</title>
	<atom:link href="http://www.cakesolutions.net/teamblogs/category/andrew-cs-blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cakesolutions.net/teamblogs</link>
	<description>void magic() { }</description>
	<lastBuildDate>Tue, 07 Feb 2012 12:02:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>October North West Spring User Group Meeting</title>
		<link>http://www.cakesolutions.net/teamblogs/2009/10/19/october-sug-northwest/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=october-sug-northwest</link>
		<comments>http://www.cakesolutions.net/teamblogs/2009/10/19/october-sug-northwest/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 08:36:16 +0000</pubDate>
		<dc:creator>Andrew Chalkley</dc:creator>
				<category><![CDATA[Andrew C's Blog]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Spring Integration]]></category>
		<category><![CDATA[Spring User Group]]></category>

		<guid isPermaLink="false">http://www.cakesolutions.net/teamblogs/?p=469</guid>
		<description><![CDATA[Last Tuesday was the North West Spring User Group. I was asked to deliver my jQuery talk that I gave to the South Spring User Group back in September last year. It&#8217;s always good talking about jQuery as it&#8217;s relatively &#8230; <a href="http://www.cakesolutions.net/teamblogs/2009/10/19/october-sug-northwest/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last Tuesday was the North West Spring User Group. I was asked to deliver my jQuery talk that I gave to the South Spring User Group back in <a href="http://skillsmatter.com/podcast/java-jee/jquery">September</a> last year.</p>
<p>It&#8217;s always good talking about jQuery as it&#8217;s relatively straight forward for the audience to read and has a shallow learning curve (if you know CSS already). One of the other pleasures talking about jQuery, and other front end tech, is that you can always show interactive demos to &#8220;wow&#8221; the audience&#8230;</p>
<p>Here are my slides followed by a link to my demo code:</p>
<div style="width:425px;text-align:left" id="__ss_2273365"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/chalkley/jquery-sug-group-introduction" title="jQuery SUG Group Introduction">jQuery SUG Group Introduction</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jquery-091019025326-phpapp02&#038;stripped_title=jquery-sug-group-introduction" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jquery-091019025326-phpapp02&#038;stripped_title=jquery-sug-group-introduction" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/chalkley">Andrew Chalkley</a>.</div>
</div>
<p>I brought some of my demo code up to date showing examples using the <a href="http://docs.jquery.com/Events/live">live</a>, event delegation functionality with jQuery. You can view my demo <a href="http://cakesolutions.net/jquery_demo/jquery.html">here</a> or download it zipped <a href="http://cakesolutions.net/jquery_demo/jquery.zip">here</a>.</p>
<p>If you have any queries about the above or want assist you in a jQuery, Javascript and AJAX project <a href="http://www.cakesolutions.net/contact.html">contact us</a>.</p>
<h2>Spring Integration</h2>
<p>Jonas Partner from OpenCredo also gave a presentation on the evening on Spring Integration. His slides are below:</p>
<div style="width:425px;text-align:left" id="__ss_2292034"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/chalkley/spring-integration-2292034" title="Spring Integration">Spring Integration &#8211; Jonas Partner</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=nwsugspringintegration-091020075822-phpapp01&#038;stripped_title=spring-integration-2292034" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=nwsugspringintegration-091020075822-phpapp01&#038;stripped_title=spring-integration-2292034" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/chalkley">Jonas Partner</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.cakesolutions.net/teamblogs/2009/10/19/october-sug-northwest/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Getting Ready to Rumble</title>
		<link>http://www.cakesolutions.net/teamblogs/2009/08/24/getting-ready-to-rumble/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-ready-to-rumble</link>
		<comments>http://www.cakesolutions.net/teamblogs/2009/08/24/getting-ready-to-rumble/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 08:08:16 +0000</pubDate>
		<dc:creator>Andrew Chalkley</dc:creator>
				<category><![CDATA[Andrew C's Blog]]></category>
		<category><![CDATA[rails rumble]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.cakesolutions.net/teamblogs/?p=429</guid>
		<description><![CDATA[This year I have entered the Rails Rumble. I am entering as a Solo developer and will be competing with over 200 teams of up to 4 people. For those of you who don&#8217;t know what the Rails Rumble is, &#8230; <a href="http://www.cakesolutions.net/teamblogs/2009/08/24/getting-ready-to-rumble/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This year I have entered the <a href="http://railsrumble.com">Rails Rumble</a>. I am entering as a Solo developer and will be competing with over 200 teams of up to 4 people.</p>
<p><center><img src="http://blog.railsrumble.com/assets/2009/7/3/rr09_badge_250.png" alt="Rails Rumble '09 Badge" /></center></p>
<p>For those of you who don&#8217;t know what the Rails Rumble is, it&#8217;s a coding competition that lasts for 48 hours. The aim is to design and build a web application in Ruby and Rails within this 48 hour slot. No digital assets are to produced before the competition. </p>
<p>I have previously entered a web-2.0y-mashup competition for Film 4 and came runner up&#8230; so I am feeling optimistic! </p>
<p>The competition is this coming weekend. Wish me luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cakesolutions.net/teamblogs/2009/08/24/getting-ready-to-rumble/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RIA Community Leader at Skills Matter</title>
		<link>http://www.cakesolutions.net/teamblogs/2009/08/10/ria-community-leader-at-skills-matter/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ria-community-leader-at-skills-matter</link>
		<comments>http://www.cakesolutions.net/teamblogs/2009/08/10/ria-community-leader-at-skills-matter/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 11:28:00 +0000</pubDate>
		<dc:creator>Andrew Chalkley</dc:creator>
				<category><![CDATA[Andrew C's Blog]]></category>

		<guid isPermaLink="false">http://www.cakesolutions.net/teamblogs/?p=406</guid>
		<description><![CDATA[Some of you may know that I teach the 4 day Core Ruby on Rails Course which includes BDD with Cucumber. After delivering a passionate course I was invited to be the Web &#038; RIA Community Leader at Skills Matter, &#8230; <a href="http://www.cakesolutions.net/teamblogs/2009/08/10/ria-community-leader-at-skills-matter/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some of you may know that I teach the <a href="http://skillsmatter.com/course/ajax-ria/ruby-on-rails-workshop">4 day Core Ruby on Rails Course</a> which includes BDD with <a href="http://cukes.info">Cucumber</a>. </p>
<p>After delivering a passionate course I was invited to be the Web &#038; RIA Community Leader at Skills Matter, which invitation I accepted.</p>
<p>Some of the responsibilities of the position is to review course material and suggest new courses in the Web &#038; RIA areana.</p>
<p>If you want to suggest a course or even deliver one feel free to contact me at <a href="mailto:andrewc@cakesolutions.net">andrewc@cakesolutions.net</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cakesolutions.net/teamblogs/2009/08/10/ria-community-leader-at-skills-matter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vertically Aligning Images with jQuery</title>
		<link>http://www.cakesolutions.net/teamblogs/2008/10/30/vertically-aligning-images-with-jquery/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=vertically-aligning-images-with-jquery</link>
		<comments>http://www.cakesolutions.net/teamblogs/2008/10/30/vertically-aligning-images-with-jquery/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 18:04:24 +0000</pubDate>
		<dc:creator>Andrew Chalkley</dc:creator>
				<category><![CDATA[Andrew C's Blog]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.cakesolutions.net/teamblogs/?p=89</guid>
		<description><![CDATA[I have often needed the to fulfil the requirement of aligning an image to the middle of a specified height. In the old table based way of doing it was pretty easy. All you needed to do was valign=&#8221;middle&#8221; on &#8230; <a href="http://www.cakesolutions.net/teamblogs/2008/10/30/vertically-aligning-images-with-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have often needed the to fulfil the requirement of aligning an image to the middle of a specified height. In the old table based way of doing it was pretty easy. All you needed to do was valign=&#8221;middle&#8221; on the cell containing the image. Things have changed (for the better) by dropping table based layouts. Unfortunately not all browsers CSS capabilities are good enough to align to the middle very easily.</p>
<p>So I came up with a solution in jQuery when working on a current project&#8217;s product gallery. Solving it programatically is alot quicker than editing every image.</p>
<p>All you need is:</p>
<ol>
<li>jQuery</li>
<li>A transparent GIF</li>
<li>And a tiny bit of jQuery magic</li>
</ol>
<p>All you need to do is set the maximum height and width to the image that you require. Then set its background colour (if needed) as well as a background image the same as current source at 50% (both top and left). Then finally replace the current image source with the transparent GIF revealing your newly centred and middlely (new word) aligned image.</p>
<p>Your code should look something like this.</p>
<p><code><br />
$(function(){<br />
		$("img.middle_aligned").each(function(){<br />
			$(this).css("width","160px").css("height","110px").css("background","#fff url("+$(this).attr("src")+") 50% 50% no-repeat").attr("src","images/blank.gif");<br />
		});<br />
});<br />
</code></p>
<p>If you have any other techniques let me know in the comments. </p>
<p>Now go and make some awesome image galleries with the aid of jQuery.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cakesolutions.net/teamblogs/2008/10/30/vertically-aligning-images-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Presentation at the Spring User Group in London</title>
		<link>http://www.cakesolutions.net/teamblogs/2008/10/14/jquery-presentation-at-the-spring-user-group-in-london/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jquery-presentation-at-the-spring-user-group-in-london</link>
		<comments>http://www.cakesolutions.net/teamblogs/2008/10/14/jquery-presentation-at-the-spring-user-group-in-london/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 12:30:57 +0000</pubDate>
		<dc:creator>Andrew Chalkley</dc:creator>
				<category><![CDATA[Andrew C's Blog]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Ruby on Rails talk presentation]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.cakesolutions.net/teamblogs/?p=78</guid>
		<description><![CDATA[Here is the presentation I gave on jQuery at the Spring User Group in London. Q&#038;A session for the whole event is at the end. Some people attended the Spring event because of the jQuery talk. Bonus!!]]></description>
			<content:encoded><![CDATA[<p>Here is the presentation I gave on jQuery at the Spring User Group in London.</p>
<p>Q&#038;A session for the whole event is at the end.</p>
<p><embed id="VideoPlayback" src="http://video.google.de/googleplayer.swf?docid=-3388042330312656216&hl=de&fs=true" style="width:400px;height:326px" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash"> </embed></p>
<p>Some people attended the Spring event because of the jQuery talk. Bonus!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cakesolutions.net/teamblogs/2008/10/14/jquery-presentation-at-the-spring-user-group-in-london/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Variety Club on Rails</title>
		<link>http://www.cakesolutions.net/teamblogs/2008/07/07/variety-club-on-rails/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=variety-club-on-rails</link>
		<comments>http://www.cakesolutions.net/teamblogs/2008/07/07/variety-club-on-rails/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 14:16:30 +0000</pubDate>
		<dc:creator>Andrew Chalkley</dc:creator>
				<category><![CDATA[Andrew C's Blog]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[charity]]></category>
		<category><![CDATA[DRY]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.cakesolutions.net/teamblogs/?p=55</guid>
		<description><![CDATA[I was tasked to provide additional functionality to the Variety Club site administrative suite. The additional functionality includes an online booking system for events using Google Checkout as the payment service provider and help volunteers manage these bookings and event &#8230; <a href="http://www.cakesolutions.net/teamblogs/2008/07/07/variety-club-on-rails/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was tasked to provide additional functionality to the <a href="http://www.variety-northwest.org.uk">Variety Club</a> site administrative suite. The additional functionality includes an online booking system for events using Google Checkout as the payment service provider and help volunteers manage these bookings and event attendees.<br />
<span id="more-55"></span><br />
The site was originally on a PHP framework. Migrating the content across to Rails was extremely easy. Due to the built-in Rails conventions and helpers I was able to create layouts, partials and views that were very <a href="http://en.wikipedia.org/wiki/DRY">DRY</a>. The views are more compact, XHTML strict and CSS based making it really easy for search engines to transverse and index content.</p>
<p><img src="http://www.cakesolutions.net/teamblogs/wp-content/uploads/2008/07/vc_valid.png" alt="The Variety Club is XHTML Valid" /></p>
<p>Not only was I able to simplify the views and write some layout helpers but I also included the additional Google Checkout and booking functionality. All this in a matter of days!</p>
<p class="center"><img src="http://www.cakesolutions.net/images/expertise/full_screen.jpg" alt="The New Variety Club Ruby on Rails Site" /></p>
<p>Ruby on Rails is a great platform for building web applications with speed and ease. We look forward to adding new features to the Variety Club North West site which on Rails, is so straight forward.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cakesolutions.net/teamblogs/2008/07/07/variety-club-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Week of Web Releases</title>
		<link>http://www.cakesolutions.net/teamblogs/2008/06/05/a-week-of-web-releases/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-week-of-web-releases</link>
		<comments>http://www.cakesolutions.net/teamblogs/2008/06/05/a-week-of-web-releases/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 09:29:16 +0000</pubDate>
		<dc:creator>Andrew Chalkley</dc:creator>
				<category><![CDATA[Andrew C's Blog]]></category>

		<guid isPermaLink="false">http://www.cakesolutions.net/teamblogs/?p=52</guid>
		<description><![CDATA[It&#8217;s been an exciting week on the web front with jQuery 1.2.6 and Ruby on Rails 2.1 being released, both providing feature enhancements and performance improvements. Here is a brief run down: jQuery Event Handling is 103% Faster CSS Selectors &#8230; <a href="http://www.cakesolutions.net/teamblogs/2008/06/05/a-week-of-web-releases/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been an exciting week on the web front with jQuery 1.2.6 and Ruby on Rails 2.1 being released, both providing feature enhancements and performance improvements.</p>
<p>Here is a brief run down:</p>
<p><a href="http://jquery.com/blog/2008/06/04/jquery-126-events-100-faster/">jQuery</a></p>
<ul>
<li>Event Handling is 103% Faster</li>
<li>CSS Selectors are 13% faster</li>
<li>.offset() is 21% faster</li>
<li>.css() is 25% faster</li>
<li>Exposed Speeds</li>
<li>.toggle() can now accept more functions</li>
<li>You can now unbind bound .toggle() and .one() functions</li>
<li>.index() supports jQuery collections</li>
<li>jQuery.makeArray can convert ANYTHING to an array.</li>
<li>beforeSend can cancel Ajax calls</li>
<li>Exposed Speeds</li>
</ul>
<p><a href="http://weblog.rubyonrails.org/2008/6/1/rails-2-1-time-zones-dirty-caching-gem-dependencies-caching-etc">Ruby on Rails</a><br />
Major New Features:</p>
<ul>
<li>Time zones</li>
<li>Dirty tracking</li>
<li>Gem Dependencies</li>
<li>Named scope</li>
<li>UTC-based migrations</li>
<li>Better caching</li>
</ul>
<p>Ryan Bates has produced some awesome screencasts on the above new features in rails. I highly recommend you check his <a href="http://www.railscasts.com">Railscasts</a> out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cakesolutions.net/teamblogs/2008/06/05/a-week-of-web-releases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brand New Site Around the Corner</title>
		<link>http://www.cakesolutions.net/teamblogs/2008/05/08/brand-new-site-around-the-corner/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=brand-new-site-around-the-corner</link>
		<comments>http://www.cakesolutions.net/teamblogs/2008/05/08/brand-new-site-around-the-corner/#comments</comments>
		<pubDate>Thu, 08 May 2008 14:13:36 +0000</pubDate>
		<dc:creator>Andrew Chalkley</dc:creator>
				<category><![CDATA[Andrew C's Blog]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.cakesolutions.net/teamblogs/2008/05/08/brand-new-site-around-the-corner/</guid>
		<description><![CDATA[When I&#8217;ve had a spare hour or two between projects I have been working on the brand-spanking new cake site. It will have some smooth UI tweaks thanks to jQuery and pretty interesting features on the contact page with integrated &#8230; <a href="http://www.cakesolutions.net/teamblogs/2008/05/08/brand-new-site-around-the-corner/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I&#8217;ve had a spare hour or two between projects I have been working on the brand-spanking new cake site. </p>
<p>It will have some smooth UI tweaks thanks to <a href="http://www.jquery.com">jQuery</a> and pretty interesting features on the contact page with integrated <a href="http://code.google.com/apis/maps/">Google Maps</a>. </p>
<p>The site is almost ready. Just a few odds and ends to tie up.</p>
<p>Once the site is launched I&#8217;ll blog a quick feature tour with some insights into the technologies used.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cakesolutions.net/teamblogs/2008/05/08/brand-new-site-around-the-corner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learn@Cake: Introduction to AJAX</title>
		<link>http://www.cakesolutions.net/teamblogs/2008/03/10/learncake-introduction-to-ajax/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=learncake-introduction-to-ajax</link>
		<comments>http://www.cakesolutions.net/teamblogs/2008/03/10/learncake-introduction-to-ajax/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 10:52:12 +0000</pubDate>
		<dc:creator>Andrew Chalkley</dc:creator>
				<category><![CDATA[Andrew C's Blog]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Browser compatibility]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://www.cakesolutions.net/teamblogs/2008/03/10/learncake-introduction-to-ajax/</guid>
		<description><![CDATA[Every Wednesday at Cake we have sessions where one of us has the opportunity to present an emerging technology. Today was my turn. With my experience in AJAX and all things Web 2.0 it was the natural choice to give &#8230; <a href="http://www.cakesolutions.net/teamblogs/2008/03/10/learncake-introduction-to-ajax/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Every Wednesday at <a href="http://www.cakesolutions.net/" title="Cake Solutions Ltd., J2EE and Open Source Software Development Specialists">Cake</a> we have sessions where one of us has the opportunity to present an emerging technology. Today was my turn. With my experience in <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29" title="Wikipedia Article on AJAX Programming">AJAX</a> and all things Web 2.0 it was the natural choice to give the Cake team a rundown on AJAX.</p>
<p>AJAX stands for <em><strong>A</strong>synchronous <strong>J</strong>avaScript <strong>a</strong>nd <strong>X</strong>ML</em>.  It is asynchronous to the extent of the JavaScript does all the requesting, loading, parsing of the XML in the background or &#8220;behind the scenes&#8221; without the disturbance of the display of the existing page.</p>
<p>Due to it&#8217;s very nature it offers advantages over non-AJAX web applications. </p>
<ol>
<li>Gives a richer user experience &#8211; create desktop-like applications</li>
<li>Makes use of existing functionality and business logic i.e. <a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself" title="Wikipedia article on Don't repeat yourself">DRY</a> code, no need to write the same functionality again in JavaScript</li>
<li>Lower bandwidth usage as data only is sent, rather than the accompanying style and layout</li>
</ol>
<p>So how does it work?</p>
<p>First you need an instance of the <a href="http://en.wikipedia.org/wiki/XMLHttpRequest">XMLHttpRequest</a> object. This in turn sends request for the XML (HTML, <a href="http://en.wikipedia.org/wiki/JSON" title="Wikipedia Article on JavaScript Object Notation">JSON</a> or plain text also) file. The XML file could be served from a data service e.g. outputted by server-side scripting, a file system or some proxy or pooling service. </p>
<p>An instance where you&#8217;d need a proxy or pooling service is where the XML data, say an RSS feed, is hosted on another domain. Browser security settings prohibit JavaScript from accessing XML data from another domain as it could initiate a <a href="http://en.wikipedia.org/wiki/Cross-site_scripting" title="Wikipedia Article on Cross-site scripting">XSS</a> attack. Say you trust the domain you are acquiring the XML data from, you need to create a proxy on your domain.  In PHP a simple proxy could be made using the following code:</p>
<p><code><br />
&lt;?PHP<br />
        header('Content-Type: text/xml');<br />
        $xml_url = "http://www.cakesolutions.net/teamblogs/feed/";<br />
        if($xml_url) print implode(file($xml_url));<br />
?&gt;<br />
</code></p>
<p>Note that when you do serve an XML file from a server-side script be sure that you send the correct <a href="http://en.wikipedia.org/wiki/Mime_type">mime-type</a> (<em>text/xml</em> in the case of XML) in the <em>Content-Type</em> <a href="http://en.wikipedia.org/wiki/List_of_HTTP_headers#Responses">response header</a>. Some browsers are more forgiving than others but for your AJAX application to work in all browsers you should include the correct <em>Content-Type</em>. That would be the best practice anyhow.</p>
<p>So do you create an XMLHttpRequest object?</p>
<p>In an ideal world the JavaScript would be as follows:<br />
<code><br />
	var xmlHttp = new XMLHttpRequest();<br />
</code></p>
<p>Unfortunately, when it comes to standards, the browser world is far from ideal. We have to do this:</p>
<p><code><br />
try {<br />
		//Firefox,Safari and Opera<br />
		xmlHttp = new XMLHttpRequest();<br />
	}<br />
	catch(e)<br />
	{<br />
		//Internet Explorer<br />
		try {<br />
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");<br />
		}<br />
		catch(e)<br />
		{<br />
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");<br />
		}<br />
	}</p>
<p>	//Handle xmlHttp state changes<br />
	//Syntax .onreadystatechange = function;<br />
	xmlHttp.onreadystatechange = &lt;Some Function&gt;;<br />
</code></p>
<p>In the first <a href="http://demos.cakesolutions.net/ajax/image.php">example</a> we see an image gallery. Note that there are HTML elements and content surrounding the gallery are the same even when you click through to image 2 and 3. It is pointless sending all these HTML elements and content again using up precious bandwidth and loading  it all  again in the browser, so lets use our new AJAX skills to load an XML with the sources and descriptions and change them dynamically. This is what <a href="http://www.facebook.com/">Facebook</a> does in their albums. Check out the following <a href="http://demos.cakesolutions.net/ajax/image.php?js=ajax">example</a>. The image sources and descriptions are contained within the <em><a href="http://demos.cakesolutions.net/ajax/images.xml">images.xml</a></em> and the JavaScript is contained with in <em><a href="http://demos.cakesolutions.net/ajax/ajax.js">ajax.js</a></em>. Note in this implementation that we are not creating a new HTML page or even changing the link sources, if JavaScript is switched off it will still work. The initializeClick function returns false, telling the browser not to load the linked page. Hence no unnecessary loading of pages as we already have loaded the XML when HTML document loads.</p>
<p>Once again, implementing functionality in JavaScript can be problematic due to the various incarnations of the implementation of JavaScript in browsers and the lengths one needs to go to to get the information one wants. You&#8217;ll find yourself after having spent  time debugging your script in Firefox, you try it in Internet Explorer and it&#8217;s broken. One way to avoid the headache of cross-browser compatibility is to use a framework.</p>
<p><a href="http://www.jquery.com">jQuery</a> has been my framework of choice for some time. It enables you to write your JavaScript code only once and you&#8217;ll be able to have the assurance that it will work in most browsers. jQuery has a <a href="http://jquery.com/test/">Test Suite</a> that has 1157 tests to check browser compatibility. All modern browsers pass the test. This also is a great way to benchmark the performance of each browser&#8217;s implementations of JavaScript.</p>
<p>Looking at the <a href="http://demos.cakesolutions.net/ajax/image.php?js=jquery">example</a> again but this time using jQuery, we see that the implementation takes fewer lines of code hence jQuery&#8217;s mantra <em>Write less, Do more</em>. </p>
<p>You can also use CSS like selectors:<br />
<code><br />
  $("div")      // returns all div elements<br />
  $(".class")  // returns all elements with the class .class i.e. class="class"<br />
  $("#id")     // returns the element with the id #id i.e. id="id"<br />
</code></p>
<p>Selecting elements by class is a very handy. If you like to do things properly, with valid markup, you will know that you can have multiple elements with the same class, whereas you cannot have more than one element with the same id. At the moment there are no native implementation of document.getElementsByClassName(). Using a framework&#8217;s implementation not only allows you to the functionality now but rest assured with later incarnations of the framework it&#8217;ll utilize the native functions, thus your code is backwardly compatible and future proof!</p>
<p>On to our next <a href="http://demos.cakesolutions.net/ajax/signup.html">example</a>, using jQuery. We have a sign up form that on certain events (See <em><a href="http://demos.cakesolutions.net/ajax/signup_check.js">signup_check.js</a></em>) will trigger an AJAX call to a service with has some logic contained within it. This in turn will output XML and a message will be displayed.</p>
<p>In the case of the Username field once the user has tabbed/clicked out of the input box (<em>blur</em>) it posts the parameter <em>user</em> to the <em>user.php</em> where the checks go on. The responses are as follows.</p>
<p><code><br />
//If the user exists already<br />
&lt;message&gt;<br />
  &lt;type&gt;error&lt;/type&gt;<br />
  &lt;text&gt;Username already taken&lt;/text&gt;<br />
&lt;/message&gt;</p>
<p>//If the user does not exist<br />
&lt;message&gt;<br />
  &lt;type&gt;notice&lt;/type&gt;<br />
  &lt;text&gt;Username available&lt;/text&gt;<br />
&lt;/message&gt;<br />
</code></p>
<p>In the case of the Password field once the user has entered more than four characters it posts the parameter <em>password</em> to the <em>strength.php</em> to see whether if the password is strong or not. The responses are as follows.</p>
<p><code><br />
//If all lowercase, uppercase or numbers<br />
&lt;password_strength&gt;<br />
  &lt;stength&gt;weak&lt;/strength&gt;<br />
&lt;/password_strength&gt;</p>
<p>//else<br />
&lt;password_strength&gt;<br />
  &lt;stength&gt;strong&lt;/strength&gt;<br />
&lt;/password_strength&gt;<br />
</code></p>
<p>Then the utilization of jQuery&#8217;s DOM manipulation functionality is used to process and output the XML data in the existing HTML document&#8217;s DOM.</p>
<p>Remember that a good AJAX application is a good non-AJAX application. When JavaScript is switched off your application should still work. It may not have all the fancy DOM transitions or the <em>rich</em> desktop-like experience but the functionality should still remain, the links should work, the server side part of the application should be able to deal with the data, error handle and do all things you&#8217;d expect from the AJAX version. First build your application without AJAX, then add additional AJAX functionality, then, your web application will be truly accessible to all.</p>
<p>Download the source <a href="http://demos.cakesolutions.net/ajax/ajax.zip">zip</a> <a href="http://demos.cakesolutions.net/ajax/ajax.tar.gz">tar.gz</a><br />
Download the <a href="http://demos.cakesolutions.net/ajax/AJAXPresentation.mov">Quicktime presentation</a> (Preview: <a href="http://uk.youtube.com/watch?v=wqg4NR9x9fc">YouTube</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cakesolutions.net/teamblogs/2008/03/10/learncake-introduction-to-ajax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://demos.cakesolutions.net/ajax/AJAXPresentation.mov" length="17370879" type="video/quicktime" />
		</item>
		<item>
		<title>Platform 4 Widget Contest Runner Up</title>
		<link>http://www.cakesolutions.net/teamblogs/2008/03/10/platform-4-widget-contest-runner-up/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=platform-4-widget-contest-runner-up</link>
		<comments>http://www.cakesolutions.net/teamblogs/2008/03/10/platform-4-widget-contest-runner-up/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 10:51:43 +0000</pubDate>
		<dc:creator>Andrew Chalkley</dc:creator>
				<category><![CDATA[Andrew C's Blog]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Award]]></category>
		<category><![CDATA[Film 4]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.cakesolutions.net/teamblogs/2008/03/10/platform-4-widget-contest-runner-up/</guid>
		<description><![CDATA[Back in December I read a post on TechCrunch UK about Channel 4 launching a competition at the Widgety Goodness conference in Brighton. The contest was to create a widget using at least one Film 4 feed and a feed &#8230; <a href="http://www.cakesolutions.net/teamblogs/2008/03/10/platform-4-widget-contest-runner-up/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Back in December I read a post on <a href="http://uk.techcrunch.com/2007/12/06/channel-4-launches-widget-contest/">TechCrunch UK</a> about Channel 4 launching a competition at the <a href="http://www.widgetygoodness.com/">Widgety Goodness</a> conference in Brighton. The contest was to create a widget using at least one Film 4 feed and a feed from somewhere else; a mash-up.</p>
<p>I decided to have a go. I used two Film 4 rss feeds, three Apple Trailer feeds and tens of dynamically generated Technorati blog search feeds to show the reaction to the films in the blogosphere. These feeds were were accessed using <a href="http://www.jquery.com">jQuery</a>&#8216;s AJAX API via a lightweight PHP proxy. My entry can be found at <a href="http://film4.chalkley.org">film4.chalkley.org</a>.</p>
<p>On Friday I <a href="http://www.channel4.com/blogs/page/platform4?entry=and_the_winner_is">found out</a> that I was one of the two joint runners up. It was not only good to win a cash prize but also the kudos given by a large innovative brand such as Channel 4 made it all the more awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cakesolutions.net/teamblogs/2008/03/10/platform-4-widget-contest-runner-up/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

