odern browsers have greatly improved their performances, development tools, and compatibility. Even though most web sites still adhere to the page paradigm, rendering their content as it would appear in a newspaper or book, browsers can support highly interactive applications that rival traditional desktop apps.
jQuery in a Nutshell
<script src="lib/jquery-1.2.6.js" ></script>
<p>The first paragraph.</p>
<p>The second paragraph.</p>
The $() function is a handy shortcut to trigger jQuery-driven manipulations. The above listing uses it twice. First, it's used to bind an anonymous function to the document.ready() event. This is how the code triggers the execution of jQuery code once the page has finished loading. Then it's used along with the p:first CSS selector to isolate the first paragraph. The css() mutator method changes its background color.
jQuery offers many more methods to transform the DOM and bind callbacks to all possible browser events. Refer to this introductory article if you want to explore jQuery in greater detail.
jQuery is highly extensible and, for the purposes of this article, the example uses two additions to the bare library: jQuery UI, a set of specialized functions to deal with visual interactions, and the mousewheel plugin, which allows an app to react to scrolling events generated by the mouse wheel.