In programming, events are actions that take place within an application. Normally these events are triggered by the end user and can include things like mouse clicks, mouse drags, keyboard actions, and others, but can also include the sending and receiving of data, changes in state of a user interface component, and many other scenarios.
The ArcGIS API for JavaScript is an asynchronous API that follows a publish/subscribe pattern wherein an application registers (publishes) events with listeners (subscribers). The following diagram illustrates this process. Listeners are responsible for monitoring the application for these events and then triggering a handler function that responds to the event. Multiple events can be registered to the same listener. The dojo on() function creates a listener that associates an event to a handler function:
As you'll recall the...