Chapter 3. Events
One of John Resig's primary motivations for creating jQuery was the need to make support for certain scripting features more seamless across browsers in a way that is as efficient and performance-aware as is possible. John has managed pretty well — his Event API not only works across all the popular, modern browsers, but it also simplifies events in very intuitive ways, reducing the amount of code that you need to write to bind events to objects.
Long a thorn in the sides of web developers everywhere is the rift in the event model supported by Internet Explorer, and the event model standardized by the W3C. Over the years, developers have come up with all sorts of creative ways to unite these different event models to have an extensible, reliable, and easy-to-use Event API. To truly understand the challenge that a developer faces when attempting to bridge the compatibility gaps in event handling, you have to understand the subtle nuisances that created the compatibility gap in the first place. In this chapter, I look at the different methods for attaching an event in more detail by providing a recap on how each ...