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.
I was a big fan of:
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.