By Peter Bell

jQuery - Even Better than Expected!

I'd been planning to play with jQuery for a while now, but earlier this week, I finally had a morning free to implement a data grid with paging and ordering of a local data set for one of my clients, so I decided to see what it could do . . .

I started by picking the great Tablesorter plugin which seemed to do everything I wanted. As a complete JavaScript n00b it took me about an hour to get the library, plug in and a couple of supporting plugins for providing paging and storing preferences in cookies setup and customized to lay out the way I wanted. For someone who knew some JavaScript, I'm sure it would have been a fifteen minute process.

The grid met my needs and the code was terse but readable. However, I've got to say that the more I read about the library the more I liked its philosophy. As a learning guide, I'm going to put together a simple "Intro to jQuery"" - I'd appreciate any input from anyone with a little more JavaScript experience, but I've got to say that so far it seems pretty cool (and it plays nicely with other frameworks and components like ext-js).

Comments
jQuery has been my js library of choice for some time now. The real power behind it, in my mind, is how readable the code becomes. It typically requires just enough code to make your desired action clear, and is very easy to modify in the future.
# Posted By Sam Curren | 8/31/07 12:20 PM
Paging Rey Bango... :)

If you haven't already - I'd join the jQuery mailing list - it's very active, and there are quite a few ColdFusion people on the list. I've been using it for a few months now - mostly on existing sites. It's been a lifesaver!! I'm really looking forward to building a site from scratch where I can really leverage it from the start. It's made me really re-think how I use CSS. I also suck at Javascript but it's been really easy (with a bit of help from the mailing list) to pickup jQuery. I'd also recommend the book (which I really need to finish reading!!)...
# Posted By Jim Priest | 8/31/07 1:13 PM
I've already got some help from the list - it is great!

What book?
# Posted By Peter Bell | 8/31/07 1:33 PM
http://www.thecrumb.com/2007/07/13/5-minute-jquery...

They are also working on a reference book which may be out now as well.
# Posted By Jim Priest | 8/31/07 1:40 PM
Another worthy table sorting library is table sorting script from Matt Kruse's Javascript Tool:
http://www.javascripttoolbox.com/lib/table/

This library also has a jQuery plugin interface coming soon if you are already using jQuery, but it isn't required. There are also more examples of code and no additional javascript is needed outside of including the js library.
# Posted By James Moberg | 9/1/07 10:53 AM
@Peter: I knew I saw you on the list the other day!!! woohoo! Well, if you need anything, let me know. I'm a member of the jQuery project team and have plenty of resources at my disposal. Also, as Jim mentioned, get the book (http://www.amazon.com/Learning-jQuery-Interaction-...=pd_bbs_sr_1/002-5540566-2350405?ie=UTF8&s=books&qid=1188687239&sr=1-1). Its definitely worth it. Here are some more resources for you to look at:

http://docs.jquery.com/Tutorials
http://www.learningjquery.com/
http://15daysofjquery.com/

API Browsers:
http://jquery.bassistance.de/api-browser/
http://visualjquery.com/1.1.2.html
# Posted By Rey Bango | 9/1/07 7:00 PM
@James, that's a pretty cool library!

@Rey, Yep, that was me. Thanks for the help, and thanks for the great resources. As for the book, it's on the way!
# Posted By Peter Bell | 9/3/07 7:29 PM
Awesome man. Anything you need, just let me know.
# Posted By Rey Bango | 9/3/07 7:36 PM
Hi Peter,
Glad you're digging jQuery. And I'm especially happy to hear that you've bought the book. :-) Thanks!

Since Jim mentioned the jQuery Reference Guide, I thought I'd mention that it's available at <a href="http://tinyurl.com/2nkreo">amazon.com</a> and at the <a href="http://www.packtpub.com/jquery-reference-guide-Ope...">publisher's site</a>.

Cheers!

Karl
# Posted By Karl Swedberg | 9/4/07 8:58 PM
Thanks very much for the comment. Eagerly looking forward to the book (should be through any day now). Would have bought the reference guide as well, but I'm just about to go walkabout for 4 months, so I'll have to use online references or I'll have no room in my luggage for clothes!
# Posted By Peter Bell | 9/4/07 11:37 PM
I'd always pooh-poohed JS libraries, preferring to write my own JS from scratch. Boy am I glad I got over myself and checked out jQuery. No going back now!

You'll find the jQuery community similar to the CF community -- friendly, helpful and intelligent folks. Welcome to the club!
# Posted By Josh Nathanson | 9/6/07 3:23 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.005.