Author Archive

Our 10k app, Video Poker!

Tuesday, August 31st, 2010

As you might be aware, An Event Apart have been running a competition to find the best web app written in 10k or less. For the web-developmentally-challenged among you, (you lucky, lucky souls…), this isn’t a great deal of space to work with, so optimization is the name of the game!

You can see the gallery of apps here. There are some truly amazing examples of what can be achieved with a little creativity, and the standard of app on display is extremely high. (Although with some rock-star calibre developers entering the competition, this was almost to be expected!)

For our own entry, I recreated the game of Video Poker (with graphics from Allan).

If you want to take a look at the uncompressed source code, it’s available on github, under the MIT License.

Ailsa Craig website goes live

Tuesday, August 10th, 2010

The Ailsa Craig Hotel came to 360innovate looking to refresh their web presence. As a fashionable, city-centre hotel, they wanted a site that would reflect not only their heritage, but their modern outlook too.

Built using a content management system, the administrators have full control over their site’s content.

You can see the result at ailsacraighotel.co.uk.

Self-executing functions in JavaScript

Thursday, July 29th, 2010

In Ryan Florence’s excellent post comparing jQuery’s approach to Mootools’, he makes a number of interesting comparisons about each framework’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, but fortunately there’s an easy, quick solution.

Ryan proposes the use of the setEach plugin to solve this issue, but to me, this doesn’t seem necessary. You can work around the issue by using a function that executes immediately, as follows.

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.

MTT Poker goes live

Wednesday, July 28th, 2010

It’s been a busy couple of weeks for site launches in the 360innovate office!

Multi Table Tournament Poker are a company that hold poker tournaments across Scotland. They hold regular (nightly) events, as well as regional and national tournaments. They came to 360innovate looking for a complex bespoke website development, involving many different league tables, a content management system, and a forum.

The main aims for this site were to ease the administrative burden on MTTP’s staff (allowing them to expand their business more easily in future), and to provide a focus for their already-strong community of players.

MTTPoker have big plans for the site, and planning for phase 2 of the development is well under way!

You can check out the site at mttpoker.com.

jQuery plugin to show and hide vertical menus

Tuesday, July 20th, 2010

It’s very common for us to show and hide vertical menus when developing sites. This idiom is particularly common on sites with a lot of submenus, such as e-commerce shopping carts.

Since it’s a technique we use so frequently, we decided to write a little jQuery plugin to make life easier for ourselves. This plugin takes nested unordered lists and turns them into expandable and contractable menus.

The plugin has the following features:

  • Dual licenced under GPL / MIT licences – do what you want with this code (as long as you leave the licence intact!)
  • Lightweight (~2Kb packed)
  • Keyboard accessible, basic WAI-ARIA support. Usable with JavaScript switched off.
  • Easy to use and deploy
  • Configurable through CSS, callback functions and numerous options

Please note that this plugin optionally uses of Klaus Hartl‘s excellent jquery.cookie.js plugin.

You can download the plugin here, and view the docs, and an example here.

A Social Media car crash

Thursday, July 15th, 2010

Companies and individuals get social media wrong all the time. It’s rare, however, to see the type of PR disaster that enveloped Gillian McKeith yesterday.

If you missed the debacle, here’s a summary:

  • A user of Twitter expressed excitement at reading a chapter of Dr Ben Goldacre‘s book, Bad Science, devoted to McKeith’s practices.
  • McKeith (or someone tweeting from her official Twitter account) responded to the user accusing her – bizarrely – of bigotry against Americans. (Since McKeith’s PhD was gained in America.) Crucially, she also inferred that Dr Goldacre was a liar. (A very serious, and indefensible defamation.)
  • At this point, the sceptic community on Twitter began picking up on the issue – tweeting with hashtags such as #Iherebydefamegillianmckeith and #gillianmckeithhasnophd
  • She quickly became one of the top trending topics on Twitter, and as the momentum started to build, she made an incredible move – her tweets moved to the third person, and she wrote a load of tweets that were sharply deleted (They are captured for posterity here). Links to her Twitter account were removed from her official site, and she tweeted “Do you actually believe this is real twitter site for the GM?” Unfortunately for her, the link to her Twitter account is still visible in the source code of the site, at the time of writing.

What could she have done differently?

Assuming that @gillianmckeith is the woman’s real account, or is at least under her control, there are many lessons to be learned from this story.

Firstly, nobody likes a bully. McKeith is renowned for being somewhat litigious and silencing her critics through legal threats. This approach is anathema to the way social media operates, where engagement is key. Your critics provide invaluable feedback, and should be regarded as an opportunity to improve your product offering.

As an example, imagine if she had sent a complimentary book to the original tweeter. Instead of creating the storm that she did, she would have come across as looking to present her side of the story; listening to her critics and reaching out with generosity rather than insults and threats.

Secondly, her response to the crisis was disastrous, to say the least. In claiming that the account was not associated with her (when clearly it had been), she showed real contempt for the online world. Dishonesty and backtracking will get you nowhere, and in any case, the situation had been captured by numerous sources – the caches of search engines, and the screenshots of many users. Links to these spread like wildfire, and will irreparably damage your reputation.

Assuming again that Gillian McKeith (and people working with her) are responsible for this situation, she has given us a prime example of why employing a professional social media management company is money well spent. If you don’t thoroughly understand the opportunities and pitfalls of social media, the damage to your reputation can be incalculable.

Please note that comments do not represent the views of 360innovate. Defamatory comments will be deleted.

So you’ve got an idea for a website?

Thursday, April 1st, 2010

If you have a idea for a website and an off-the-shelf system just won’t cut it, you might be in need of bespoke web development. As specialists in this field, we talk to a great many people who have ideas for online businesses, and in this article, I’d like to outline some points to help you get the most from your development experience, and your business.

Treat your online business like an offline business

“Information technology and business are becoming inextricably interwoven. I don’t think anybody can talk meaningfully about one without the talking about the other.” – Bill Gates

Before you even think about beginning development, it’s essential to research the market thoroughly, and one of the best ways to formalise this process is to write a business plan.

A business plan will encourage you to think about your business objectives and strategies, the markets in which it will operate, and its financial projections. In doing this, you’ll spot potential pitfalls earlier, and be better able to plan the future of the business. (And perhaps even decide whether you will proceed with the business or not!)

Once you’ve completed your business plan, it’s a good idea to gather feedback from neutral parties (in other words, not family members!) Banks, investors, and business partners are all good sources of feedback at this stage.

Most importantly, think about your unique selling point. What problem will your website solve? What can you do that your competitors can’t? These are age-old questions, and they are just as important when doing business online.

In addition, it’s a good idea to prepare everything you need to launch well in advance. Imagery, content, and stock all need to be readied prior to launch, as do any payment gateways. Make sure you’re ready to kick-off your website with a bang, just as you would launch a bricks-and-mortar business with a bang.

KISS – Keep It Simple, Stupid!

“A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away.” – Antoine De Saint-Exupery

The most successful websites have simplicity at their heart. Think about two obvious examples, Google and Twitter.


Although these sites offer some very complex functionality, their core actions could be described in a couple of sentences. This has an effect on the interface – key actions are thrust to the forefront of the user’s attention, giving the impression that the site is easy to use.

By keeping your application simple, you will also reduce development time, and therefore keep development costs low. So when you’ve thought about all the functionality you would like for your site, go through that wishlist again and cut out anything that doesn’t directly and obviously benefit the user. Be brutal – it can always be added at a later date if your users need it.

Also, reconsider any internal features that could be dropped to reduce costs while the business is starting up. For example, you might want your web site to integrate with an accounting package, but if you are only anticipating a couple of orders each week, could this data be migrated manually? If this feature could be rolled out at a later date, that’s money in your pocket right now that you can invest in marketing your website.

Whatever you do, be aware of the ‘kitchen sink’ mentality and avoid it!

Launch early, launch often

“I like to launch early and often. That has become my mantra” – Marissa Mayer (Google)

Some of the biggest and most successful companies espouse launching early and often. This means that websites and applications are launched as early as possible, even if some features are not in place. The main benefit of this is that you gain invaluable feedback at an early stage, allowing you to tweak your product based on what your user actually wants – not what you think they want.

Again, this mindset helps to reduce costs since you don’t spend time developing features that your users don’t…well…use!

Think about your post-launch strategy

“Business has only two functions – marketing and innovation.” – Milan Kundera

A common mistake is to consider your website ‘finished’ once it has launched. From online marketing to developing new features, you should always be thinking about how you can provide a better service for your users. Look at what your competitors are doing on a regular basis – think about what works for them and what doesn’t work for them.

Remember that these activities cost money, so don’t spend every penny of your budget before your site has launched.

jQuery 1.4 Reference Guide review

Tuesday, March 16th, 2010

In the interests of full disclosure, Packt Publishing sent me a copy of this book for me to review. There was no other compensation received for this review. I am reviewing this book for the benefit of the blog readers.

The recent release of jQuery 1.4 brought a plethora of new features and major performance improvements across the board. At the same time, the new jQuery API site was launched in an effort to improve the documentation and community spirit. Make no mistake, 1.4 is a milestone release for jQuery.

To mark this, Karl Swedberg and Jonathan Chaffer have released the jQuery 1.4 Reference Guide, an exhaustive tour of the functionality that jQuery 1.4 offers. There are eleven chapters, covering selectors, DOM traversal and manipulation, events, effects, AJAX, plug-ins, and more. In addition, there’s an alphabetical API reference guide and a couple of really useful appendixes providing lots of handy information.

As I mentioned above, each chapter groups together jQuery methods with a common theme. There are helpful code samples for each method, and they are explained thoroughly in the accompanying text. Occasionally, performance tips are mentioned, but as the book stresses early on, you shouldn’t worry too much about micro-optimizing code – your time as a developer is more valuable than that!

So who is this book aimed at? Well, as the name suggests, this is a reference guide. A familiarity with jQuery syntax is essential, and in some areas, a decent knowledge of vanilla JavaScript will be beneficial too. Although there are hints and tips peppered throughout the book, this is no tutorial book. If you’re not familiar with jQuery, you should pick up Learning jQuery instead, by the same authors.

As such, I would recommend this to the intermediate to advanced jQuery user. You will almost certainly learn something from the book, and a reference guide always comes in handy! Some of the major points I picked up were:

  • Many jQuery methods accept anonymous functions as parameters now – this is a really clean, practical way of writing code
  • There are more ways to measure elements than I realised – I knew about .height() and .width(), but not .innerHeight(), .outerHeight() etc. This has caused me problems in the past!
  • The Sizzle selector engine is really, really powerful and I’m not using it to its full potential.

The downside of a book like this is that it dates relatively quickly. For example, jQuery 1.4.2 introduced two methods – .delegate() and .undelegate() – which are not covered in the book. There’s no getting around this when the library itself is under heavy development, but it’s something that you should be aware of if you’re considering purchasing.

I also spotted one error  that I reported at the publisher’s website, so if you do purchase this book, you should keep an eye on the errata there.

However, if you’re looking for a jQuery reference guide, this is the book to own. The publishers will donate to the jQuery project for every copy of the book sold and you will learn something from this book, so it’s a win-win situation! The jQuery Reference Guide is on sale now, with a cover price of £24.99.

jQuery UI 1.7 – The User Interface library for jQuery – reviewed

Thursday, February 25th, 2010

jQuery UI 1.7 by Dan Wellman

jQuery UI 1.7 by Dan Wellman

jQuery UI is the official interface library for jQuery, the leading JavaScript framework. Dan Wellman‘s book, jQuery UI 1.7 – The User Interface library for jQuery, is intended to be the ‘missing manual’ – fleshing out the online documentation with examples, tutorials, and an in-depth look at the API. The book is supported by many great code samples, which are available at Packt’s support site.

There are thirteen chapters in total, covering the high-level widgets (such as the accordion) and low-level widgets (such as the draggable and droppable interaction helpers.) In addition, the CSS and effects frameworks are covered too.

No knowledge of jQuery UI is assumed, although it is expected that the reader will have a decent grasp of HTML, CSS, and jQuery. The book is pitched at the beginner to intermediate level jQuery UI user, although I would think that even advanced users will find that it contains valuable information.

The structure of each chapter is similar. Starting with the most basic example to get you up and running, more options are gradually introduced to give you a greater level of control, with plenty of code samples to help you along. Most chapters finish with a more advanced scenario, showing some really imaginative uses in which jQuery UI shines. For example, the drag and drop chapter walks the reader through creating a simple game.

The book also takes the time to describe some of the rare occasions where cross-browser issues might rear their heads, along with the fixes. It would have been easy for the author to skip past those parts, but I appreciated this honest approach. It may not be the sexiest subject matter, but it’s something that we as web developers deal with on a day-to-day basis, so it was great to see it tackled in the book.

One of the major strengths of jQuery UI is its online documentation; there are several examples for each widget, and options and methods are well documented. I was initially a little concerned about what the book could add to this, but my concerns were unfounded. Every chapter revealed methods and options that I had missed, along with examples that used the library in ways I would never have thought of.

One of the biggest revelations to me was the chapter relating to the CSS framework. Although I’d used Themeroller before, I’d never appreciated the full extent to which it can be used, creating a consistent look and feel throughout your site and containing many valuable helper classes.

One area where I would have liked to see some information is that of extending jQuery UI. I would have liked to have read about writing your own widgets, inheriting from $.widget, but I appreciate that this would probably be out of scope for this type of book.

Although jQuery UI 1.8 is just round the corner, I would have no hesitation in recommending this book. There is a wealth of information here, and it is presented in such a way that the reader is given a real understanding of the library, meaning that you won’t have any problems when the next version rolls along. In fact, if you read this book now, you’ll be well prepared for all the goodies that 1.8 contains!

So if you’re looking for a jQuery UI book, you should definitely check this one out!

Serving html5 videos with Apache

Wednesday, February 24th, 2010

Just a quick tip today – the solution to a bit of a ‘gotcha’!

While writing the jCaps plugin, we came up against an issue where .ogv videos were refusing to load, but bizarrely, only in Firefox. In its place was a grey box where the video should be, with a question mark in the middle.

After a little bit of head-scratching, we found the solution – Apache wasn’t sending the right MIME type with the video, resulting in a Firefox fail. The solution is to put the following AddType directive in your .htaccess or httpd.conf file (mod_mime is required):

AddType video/ogg .ogv

Make sure that you restart Apache if you put it in httpd.conf.

On another note, jCaps is nearing another release – hopefully this week. It will take into account some of Bruce Lawson’s wishlist, and includes a big refactoring of many elements of the plugin, including the API. It should be leaner, meaner, and easier to use! In the meantime, you can fork or download the project at Github.