Chapter 6. Events are where it happens!

 

This chapter covers

  • The event models as implemented by the browsers
  • The jQuery event model
  • Binding event handlers to DOM elements
  • Event delegation
  • Namespacing events
  • The Event object instance
  • Triggering event handlers under script control
  • Registering proactive event handlers

Like many other GUI management systems, the interfaces presented by HTML web pages are asynchronous and event-driven, even if the protocol used to deliver them to the browser, HTTP, is wholly synchronous in nature. Whether a GUI is implemented as a desktop program using Java Swing, X11, or the .NET Framework, or as a page in a web application using HTML and JavaScript, the program steps are pretty much the same:

1.  Set up the user interface.

2.  Wait for something interesting to happen.

3.  React accordingly.

4.  Go to step 2.

The first step sets up the display of the user interface; the others define its behavior. In web pages, the browser handles the setup of the display in response to the markup (HTML) and style (CSS) that you send to it. The script you include in the page defines the behavior of the interface, although it can change the user interface (UI) as well.

6.1. Understanding the browser event models

 
 

6.2. The jQuery Event Model

 
 
 
 

6.3. Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest