Publish Date: 6/19/2009
Dave Ward specializes in writing about ASP.NET, jQuery and ASP.NET AJAX. He is a contributing author to ASP.NET Ajax in Action, Second Edition from Manning, Nerd Dinner’s JavaScript secret weapon, listed on the Programming homepage of Alltop and newly inducted ASP Insider.
Note: Be sure to check out the Fast Feed if your are looking for the same content in 3/4ths the time!
What is jQuery?
The jQuery movement is seemingly everywhere, but if you still remain curious what jQuery is, Rick Strahl has an excellent introduction to library here: An Introduction to jQuery.
The jQuery Wikipedia page tells us that jQuery contains the following features:
- DOM element selections using the cross-browser open source selector engine Sizzle, a spin-off out of jQuery project
- DOM traversal and modification (including support for CSS 1-3 and basic XPath)
- Events
- CSS manipulation
- Effects and animations
- Ajax
- Extensibility
- Utilities - such as browser version and the each function.
- JavaScript Plugins
Dave’s jQuery Tips for Web Developers
- Learn the selectors -they are crucial!
- Leverage CSS classes instead of element IDs
- Avoids the ClientID issue
- Good for selecting groups, like GridView rows.
- Look for plugins before reinventing the wheel
- Conversely, be sure you need a plugin
- Classic example is using an accordion when slideToggle is all you really needed.
- Similarly, a lot of people don’t realize they can use $.each()
- Don’t be afraid to use fake CSS classes as “flags”
- Blackjack game example: .card.flipped and .card:not(.flipped)
- Write Unobtrusive JavaScript
- Use Firebug
- Take advantage Bookmarklets
- jQueryify – inject jQuery into any page, for testing through Firebug
- SelectorGadget – Very helpful for learning selectors interactively
- Minify and Combine your scripts
- Boost Serving Time
- Take advantage of JavaScript IntelliSense
Other Resources Mentioned in the Show