Widgets

Last week I have completed a small project for SpangaS, a Dutch television series for teenagers. They are starting their new season on September 13th and wanted a count down on the website. I went the extra mile and made this in Javascript instead of just Rails.

Widgets like these really beg to be implemented in Javascript. I could have stuck to my original assignment and made the entire thing in Rails, fully integrated into my existing code. But then it could not have been re-used on other websites easily. And for a series like SpangaS, a lot of websites exist. From the top of my head I count four official ones.

By splitting the back-end code from the front-end, and doing the latter in Javascript, I enabled a viral aspect of this count down widget. Implementing it in any website takes just one line of code. In fact, if you are reading this before 13 September 2010 you will see this widget in action in the right-hand column of spacebabies.nl.

It has the added benefit of keeping the core website code clean as well.