BBC Glow – a New JavaScript Library

The British Broadcasting Corporation has released Glow, a new open source JavaScript library. The library has been used extensively on the BBC.co.uk website since late 2007 and offers the usual features, such as:

Simplified DOM manipulation and event handling

Custom user interface widgets, such as sliders and overlay boxes

Animation and effects

Useful cross-browser JavaScript functions

The question is: why did they bother? The BBC was using jQuery and there are many other JavaScript frameworks which would have served the same purpose. The BBC reviewed several of the more popular libraries but found none that met all of their strict guidelines. Accessibility and browser support were the main issues — the BBC requires level 1 IE6 support and also tests their sites in IE5.5.

So how does Glow compare to others? Glow uses namespaced code similar to the Yahoo! User Interface Library. It is generally well thought out and logical, although it can lead to slightly verbose statements.

// fade out an element in 1 second
glow.anim.fadeOut("#myelement", 1);

One major positive point is the Glow documentation — it’s excellent and contains plenty of example code snippets and demonstrations.

But does Glow offer any compelling reasons to switch from your current library? It’s unlikely; not unless you’ve experienced significant problems or require the same level of browser support implemented by the BBC.

Overall, I like Glow. It’s well documented, has been extensively tested, and is possibly a little easier to understand than jQuery. That’s a good thing because, as a British resident, my TV licence fee has paid for Glow. I am therefore able to accept any donations you want to make toward further development of the library!

Craig is a freelance UK web consultant who built his first page for IE2.0 in 1995. Since that time he's been advocating standards, accessibility, and best-practice HTML5 techniques. He's written more than 1,000 articles for SitePoint and you can find him @craigbuckler

Free Guide:

7 Habits of Successful CTOs

"What makes a great CTO?" Engineering skills? Business savvy? An innate tendency to channel a mythical creature (ahem, unicorn)? All of the above? Discover the top traits of the most successful CTOs in this free guide.

aardvarked

That’s one one hell of an ugly logo..

cts91

This just annoys me. Not only do the BBC force IE6 usage (watch their shows and you will see all the internet shots are in IE6), but are actually encouraging people to support it! Even 5.5! Drop support already, damn it.

@LeonardChallis

In the recent sitepoint podcast #20, the guys talked about how it was a great step for YouTube to effectively start closing the door on pre-ie7 users. Though sometimes web sites really do need to accept older browsers, most sites with any kind of “wow” factor need a modern browser, if nothing else to save huge amounts of time developing and bug testing.

ooblez

makes sense, the BBC has to by law provide for more-a-less everyone who pays the license fee – it cannot partake in the browser wars.

If you remember, there was a fuss a whilst back over iplayer being windows only, and it landed the BBC in a whole world of hurt, the service has to be device independent.

The accessibility side of things relates to this and I can see why many would find this useful.

Jaffa The Cake

@aardvarked That’s not actually our logo (no idea where it came from). The real logo can be found on http://www.bbc.co.uk/glow

Shadow Caster

The Glow core is 83kb, a little heavier than JQuery which is 56kb.

I really like their timeline application is really good.

It’s relatively easy to work with (beats YUI), but I’m still a JQuery guy so I’m sticking with it and I see no immediate reason to change.

Jaffa The Cake

@cts91 The BBC doesn’t force anyone to use IE6, I certainly can’t think of any examples of this.

Yes, we actually encourage people to support IE6, in fact we require it of our developers. I’m not sure why this is a bad thing? IE6 has more users than Safari/mac (which we also support) & a lot of people have no choice but to use IE6.

Our IE5.5 support is very minimal. We supported it when we started (and IE5) so there is support for it in some core modules, but now it’s a “level 2” browser we only have to ensure our code doesn’t cause any parse errors. Glow doesn’t fire a “ready” event for IE5.5 (and other level 2 browsers) so widgets won’t load and the dom shouldn’t be modified. If the developer has coded with progressive enhancement in mind, users of old browsers such as IE5 won’t get enhancements but will have full error-free access to the page’s content and navigation.

http://www.patricksamphire.com/ PatrickSamphire

cts91: that’s fairly absurd. How are the BBC forcing people to use IE6? I’m using Firefox on a Mac and all the BBC stuff works for me…

Do you mean forcing developers? If so, only developers working on their own sites, and that’s up to them, surely?

The BBC has a vast website and it makes sense for them to develop something that meets their exact needs rather than to wrestle an open source solution into shape thousands of times.

http://www.audiomelody.com masm50

I’m not sure I’m going to find any use for this over and above jQuery, but it is always good to see the BBC release some of the tech they use and develop with out License Fee.

The Dirac video codec is another which I just wish gets taken up by developers as it is a truly open source video codec that just compresses better than the current h.264 – http://diracvideo.org/

Anonymous

It’s a huge and innacurate sweeping statement to say that what the BBC develops is done with “our license money”. The BBC does make a significant amount of its income through its own private enterprise.

http://www.optimalworks.net/ Craig Buckler

The BBC does make a significant amount of its income through its own private enterprise.

So why does it need the licence fee?!?

http://www.patricksamphire.com/ PatrickSamphire

So why does it need the licence fee?!?

Because the income from other activities is only a proportion of the money it needs? You might as well ask why other channels need advertising when they too can exploit their properties commercially.

http://www.brothercake.com/ brothercake

exactly

http://www.brothercake.com/ brothercake

(that Anonymous comment was me, by the way – i pressed the wrong button!)

http://www.optimalworks.net/ Craig Buckler

So what point are you making? Does the BBC need the licence fee or not? If it does, then my contribution has paid toward Glow! If the BBC was commercially funded, they probably wouldn’t have such stringent browser requirements and might not have developed Glow in the first place.

For the record, I’m not against the licence fee. However, it’s hardly inaccurate to say that the BBC is funded by UK licence fee money. If it weren’t for the licence fee, the BBC could not make such great products (whether they are commercial successes or not).

Ross

Kudos to BBC for releasing Glow as open source. I’m actually quite excited about it, and look forward to doing some real work with it in the near future.

P.S. the main reason I hate IE6 is because of it’s poor standards support and all the extra work I have to do to get sites to work in it. As much as I’d like to ignore it, I can’t since people are still using it. If Glow happens to support IE6, that only helps because it means less to fix.

Cheers BBC!

http://www.brothercake.com/ brothercake

My point is that you saying “my TV licence fee has paid for Glow” is an innacurate sweeping statement. But then you’re fond of those aren’t you :P

http://www.optimalworks.net/ Craig Buckler

I apologise. Readers could make the assumption that my own personal licence fee has paid for the full development of Glow. That is not the case; I’m sure Glow cost more than £120 per year and I am just one of the many millions of licence fee payers. I will endeavour to be more pedantic with my wording in future!

http://www.brothercake.com/ brothercake

Sigh. You don’t have to be pedantic, you just have to be honest in your words.

http://www.patricksamphire.com/ PatrickSamphire

Silly argument, this. None of us know exactly how the BBC arranges it’s funding. I have no idea whether web development comes from the licence fee portion, the commercial income or a mixture of the two. It doesn’t really matter, though. Even if it’s not the licence fee, the BBC is obliged to share what it produces more widely. That includes content and technology. (Witness the fact that they will be sharing news footage with newspaper websites.)

http://www.optimalworks.net/ Craig Buckler

@PatrickSamphire
Absolutely. The BBC receives income from a variety of sources. Unless they’ve got weird overly-complex accounting procedures, it all goes into one big pot and is distributed to Glow and other projects as necessary. UK licence fee payers have paid toward Glow’s development costs. That brings us nicely full-circle!

Donkey Boy

<blockquote><p>I’m sure Glow cost more than £120 per year… </p></blockquote>

Well, knowing several of the developers working on glow I’d say that £120 just about covers it :)