You are previewing Secrets of the JavaScript Ninja.

Secrets of the JavaScript Ninja

Cover of Secrets of the JavaScript Ninja by John Resig and Bear Bibeault Published by Manning Publications
O'Reilly logo

Chapter 13. Surviving events

This chapter covers

  • Why events are such an issue
  • Techniques for binding and unbinding events
  • Triggering events
  • Using custom events
  • Event bubbling and delegation

The management of DOM events should be relatively simple, but, as you may have guessed by the fact that we’re devoting an entire chapter to it, sadly it’s not.

Although all browsers provide relatively stable APIs for managing events, they do so with differing approaches and implementations. And even beyond the challenges posed by browser differences, the features that are provided by the browsers are insufficient for most of the tasks that need to be handled by even somewhat complex applications.

Because of these shortcomings, JavaScript libraries ...

The best content for your career. Discover unlimited learning on demand for around $1/day.