// you’re reading...

unconference

Michael Heap: jQuery For Everyone

Michael starts by intoducing jQuery, a Javascript library designed to provide functionality based on CSS selectors and lift the burden of cross-browser incompatibility from the programmer.

Michael’s bravely doing live demonstration of the functionality of jQuery, using Firefox and the Firebug plugin. He builds an HTML table and demonstrates the capability to modify the CSS styling of the table rows based on selectors, switching on zebra-striping, selecting a specific row by index and selecting an element by pattern matching part of an ID.

This kind of manipulation is difficult to do and very error-prone in raw Javascript. Using jQuery takes the complexity away and can make these changes in a single line of code, that Michael’s editing on the fly.

Looking around the room, there’s a wall of laptop and netbook lids open with folks trying out what Michael’s demonstrating and twittering about it.

He then moves on to show how functions can be easily defined in jQuery and bound to events that may occur in the browser. He pops up an alert window when the user clicks on an element in the HTML document.

It’s a great demonstration of the ease of programming in jQuery. Michael was taking questions during the demonstration and adapting the demonstration quickly to provide an answer.

In the next part of his demo, Michael demonstrates how quickly and easily simple web services can be used within jQuery, when he requests a chunk of JSON data fromĀ  a webpage and logs the output to the console. In three lines of code – if you include the line with the closing brace, bracket and semicolon.

To add context to the request based on the element that was clicked, we’re looking at a couple more lines of code. Now, we have a list of elements being created on the fly in the document. He’s not happy with the results jerkily snapping out, so he adds an extra line of code which smoothly slides out the new elements.

As he says, that functionality is moving towards a practically useful application.

He finishes with questions. Me: why jQuery over other Javascript frameworks? Michael responds that the frameworks tend to have specialities, but jQuery has a small footprint and is very easy to use. It can also be used in conjunction with other frameworks.

He also mentions that jQuery has a thriving community producing plugins and documentation.

Steve Frost mentions confused.com – they recently introduced jQuery to the website and ‘made it tens times more usable for 19k banwidth’.

Round the room, it’s pretty clear that we’ve been blown away. A great session.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Discussion

One comment for “Michael Heap: jQuery For Everyone”

  1. [...] [almost] perfectly first time, and I enjoyed the session. As I can’t review my own session, here’s one from Paul Brabban who blogged the session as it happened. Michael starts by intoducing jQuery, a Javascript library [...]

    Posted by UnSheffield | MichaelAHeap.com | 9 August 2009 19:11

Post a comment