Events are pretty straightforward creatures. We looked at how the binding dialog is really a visually tooled version of dojo.connect()
in Chapter 2, Digging into the Architecture. Binding via connect registers a function to be called when an event occurs; "when X happens, please also do Y". We will look at this in detail in a short while.
If events are easy to understand, you'd be forgiven for not expecting asynchronous events to be one of most common sources of trouble. Not understanding the impact of the "A is for asynchronous" part of AJAX is a common cause of frustration in accessing service call results.
When the browser invokes an asynchronous server call, for example using a service variable, the browser sends the request off to the server, but it doesn't wait idle until it receives a response. For example, if you used the following code in your application to invoke a service variable and immediately fetch the results, the result
variable will be undefined...