Case Study: How Boxee.tv uses jQuery

Just Posted: Apple Likely to Give Education Rather than Resolution for iPhone 4 Antenna Issues

If you haven’t heard of Boxee, it’s a piece of software that enables you to manage your images, music and video files on your computer, whilst integrating with social networks and the web to bring in reviews about your content, and allowing you to shout out to the likes of Twitter about the stuff you’re into. Whilst the app is cool, we’re interested in the website, and their use of jQuery – so let’s check it out!

BlockUI

BlockUI

The main jQuery plugin that Boxee.tv is using is BlockUI. The key point to BlockUI is simple, it stops user interaction with your web application whilst your code is simulating synchronous ajax calls. Why do you need this? Well, if you don’t use it, the browser becomes locked whilst the ajax calls happen, and that’s not a good user experience.

BlockUI works by bringing modal windows up front to the user whilst behind the scenes, the neat stuff is happening. Boxee utilise this in many ways:

  • When validating new user accounts
  • Recovering Passwords
  • boxeerecoverpassword

  • When updating your account preferences
  • When adding friends
  • General user feedback

BlockUI is extremely flexible, and also includes some great documentation. Their demo page is also a great place to go to see how you can utilise this plugin…

Corner Plugin

Corner PluginFor UI lovelyness, Boxee.tv has opted for the Corner Plugin. The plugin is very simple, it allows you to give custom corners to DIV elements, such as rounded, or notched. There are loads to choose from, and implementation is dead simple.

Autocomplete

autocompleteJörn Zaefferer’s Autocomplete plugin isn’t working in Boxee.tv as far as I can tell, however it is included in their “Find Friends” page. I assume when typing in friends names, live matches would appear, but it either doesn’t work for me, or is not fully implemented. To be clear, the plugin does work for me elsewhere, just not on Boxee.tv.

Other Plugins

Boxee.tv are also using the Dimensions plugin which gives you greater flexibility and cross browser compatibility for element positioning and obviously, dimensions :-) . Dimensions is now included as part of the jQuery core, so no need to download it as a plugin. Just get the latest version of jQuery.

BGIframe is also being used to “ease the pain” of IE CSS z-index issues.

General Stuff

So what else? The guys at Boxee.tv are using alot of jQuery CSS property setting code – for example:

$('.field').blur(function()
{
this.style.backgroundImage = '';
this.style.backgroundColor = '#ffffff';
})

They’re also registering various .click() events for their BlockUI modal windows. Nothing too much to talk about there really!

Conclusion

I hope you found this short article a nice insight on how these guys are using jQuery. I hope to add more as we go along, so feel free to suggest any that you’d be interested in seeing by leaving me a comment.

Some books to help you learn:

Learning jQuery

Learning jQuery

JQuery In Action

JQuery In Action

jQuery Reference Guide

jQuery Reference Guide

8 Responses to “Case Study: How Boxee.tv uses jQuery”

  1. tom sella says:

    thanks for the review!

    blockUI is great, and while in app.boxee.tv we have it poorly implemented, it still works great. our next implementation of it will be better, similarly as done at http://www.boxee.tv.

    corners we’re less happy with, and will probably will remove it in the next implementation. i personally feel we can achieve better, and more cross browser compatible, results with simple corner images.

    another great feature from jQuery worth mentioning is $(..).each(…) which allows you to iterated through items, applying a function to each.

  2. Steve Reynolds says:

    Thank you for replying :-) spread the word!

  3. Lim Chee Aun says:

    What do you mean by ‘jQuery CSS property setting code’?

  4. Steve Reynolds says:

    If you see the code snippet I have posted above, the jQuery is setting a CSS property on the blur event of an element in the DOM… does that make more sense? :)

  5. ajpiano says:

    why not review a site that actually uses jquery well? or at least is a worthwhile example for people to strive towards, as opposed to 200 lines of global function declarations with a bunch of native dom methods strewn about for good measure?

  6. Steve Reynolds says:

    Point taken, however the point of the article is not to necessarily highlight good/bad implementations of jQuery, it’s more towards how developers are using it in high profile sites like Boxee or the White House website for example. I will be broadening the scope of the case studies though and will take your feedback on board… If you have any particular sites where you can suggest a good implementation, feel free to send me the details so I can take a look…

  7. Hey, you know what? The theory that IsoftwareTV was just another scam product, was totally wrong! Isoftwaretv really works! From here I can see all kinds of tv-shows, sports, movies, news, etc. There is really a great diversity in types of TV shows to choose from.

  8. Pat Cibula says:

    Extremely interesting post, I appreciate you taking the time to place this collectively for visitors like me.

Leave a Reply