Chapter 6. Event Management
goog.events package is responsible for managing
events and listeners throughout Closure. In addition to handling traditional
DOM events (such as
Closure makes it possible to manage custom, user-defined events through the
same API. This consistency is a refreshing deviation from the existing mess
of inconsistencies in event handling across web browsers today.
A Brief History of Browser Event Models
In the process of Netscape and Microsoft’s battle royale to become
the maker of the most popular web browser, they improved their respective
event models in similar (but different) ways. Both models provided an API
that would take a string to identify the type of event to listen to and a
function to call when the event was fired. However, the string values
"onclick") as did the
this referred to when the callback function was executed (the callback function’s arguments were also different). ...