X
Business

John Resig explains the status and future of jQuery

Editor's note: Andrew Mager is reporting from the Future of Web Apps (FOWA 2010) conference, held in Miami from February 22 to 24. Click here to read all of his coverage.
Written by Andrew Mager, Inactive

Editor's note: Andrew Mager is reporting from the Future of Web Apps (FOWA 2010) conference, held in Miami from February 22 to 24. Click here to read all of his coverage.

The following is just some scattered notes from John's talk, not his actual words

Javascript is everywhere online now. It's no longer optional to build websites that have dynamic behavior happening on them. We need to now build slick, simple, fast JS applications. John Resig, creator of jQuery, gave a quick talk about the latest and greatest tips for JS developers.

DSC01011

I tried to take good notes, but it might be all over the place. Enjoy:

Event delegation is an efficient way to watch for an event on a large number of elements. It works by binding to a point further up the DOM tree and watching for bubbling events. jQuery has two ways to do this: .live() (as a direct replacement for .bind()) and .delegate(). This works on all current, and future elements. It's much faster and scales a lot better than .bind(). The delegate() function is brand new.

Use document fragments when parsing HTML in your Javascript.

Document fragments

Load jQuery from a CDN. The files are automatically minified and gzipped. Use Google Closure or some other minifier.

Use unobtrusive scripting. Take something that works already and layer on functionality on top. jQuery makes this very easy. In order to traverse and manipulate the page, we must wait until it's ready to be used. No more inline JS :)

Use jQuery's built-in data store instead of setting/getting values the old way. You can build custom events with their own namespaces even.

The jQuery guys are working on rewriting Ajax, templating, and mobile support.

Editorial standards