How about it? Could you give me a few thoughts on why I should be taking up jQuery, pros and cons perhaps?
Apologies for the late reply, but to answer you question in the method you suggested:
Pros for jQuery:
- Cross-browser compatibility (Standardization for events and Ajax)
- Initially small learning curve
- I mentioned Ajax already, but jQuery makes Ajax super easy
- Easy and fast to learn, if you can read CSS, you can start using jQuery
- When combined with gzip/deflate on your web server, including jQuery is like including a small image on your site (less than 20k)
- jQuery has several project families that build on one another to give you everything from widgets, drag-and-drop, to mobile development (jQuery UI and jQuery Mobile)
To explain the list above, jQuery combines ease of use with speed. By being able to chain methods together you can write easy-to-read code that fits on either one or a few lines that would otherwise take up a paragraph. By dealing with browser specific behavior you are free to focus on what you want your code to do rather than adding separate code blocks for different browser types. This is especially useful when creating and using Ajax. No longer do you need include one block for IE and one block for everyone else.
The selector engine in jQuery is really rather amazing; you can get any object you want in the DOM quickly and manipulate it with extreme ease.
Depending on your use case and your server technology, jQuery may be a bit large to include on some projects, however compared to other libraries it comes in at rather a 1/4 of the size (yes, there are other libs like zepto that have the similar selector engines and are considerably smaller than jQuery, but they lack all of the features of jQuery).
Including the other jQuery projects, such as jQuery UI, help when dealing with creating buttons, lists, calendar/date select objects, progress bars, draggables, and more. jQuery Mobile can be used to help standardize the way your site or web application functions on a variety of devices and offers fallback solutions for devices that would otherwise be unable to view your site. jQuery Mobile also handles swipe events, touch vs click events (and the 300ms delay), and gives you a variety of effects, widgets, and events to use. No matter what your application entails, the odds are that someone has done it before or run into the same problem. And that means that they have probably found or written a plugin for it. jQuery has a very large list of plugins that can be used to help you do a little bit of everything.
Cons for jQuery:
- Can be a developer "crutch"
- May "bloat" page size when included in projects that really do not need it