The best jQuery / Prototype book for the ajax complex?


I've been working on a complex app with one main dashboard. I don't particularly like the design because it tries to do too much on one page. So the lead developer thought it would be a good idea to use ajax - because the page is so big. Refreshing part of it is far faster than loading it again.

Problem is there's several ways data can be used.

  • Adding items
  • Editing rows
  • Performing actions on selected rows (selected using a checkbox)
  • Changing single items (like location, phone)

My problem is making GENERALIZABLE ajax code that can operate on the data in a div, using class names to assemble the proper information for the ajax call. I did pretty well, but can't help but want to see if there's a better way to do it.

Before I dug into jQuery, I did a lot of searching for Javascript best practices and bookmarked several articles which helped me to get my head around generally good Javascript ideas (such as unobtrusive Javascript, etc). It's possible to use jQuery or another library and do it in a way that's full of code smells.

I was a big fan of:

I don't go very far on the web without JavaScript: The Definitive Guide, 5th edition for language tips and traps.

From there, rather than picking up a jQuery book I looked online for best practices specific to jQuery. James Padolsey's jQuery Code Smells was a great post. The jQuery documentation provides tons of great code samples. I did a lot of looking into jQuery plugins (great for modularizing your code) and bookmarked A Plugin Development Pattern.

If you do want a book on jQuery, the one that came up over and over again in my reading was Learning jQuery, but based on the rapid evolution of the language, I've found that the web has more recent information.