Chapter 15.2. Handling JavaScript Events with MochiKit.Signal

Event-driven programming is a handy model for making graphical user interfaces. The browser developers recognized this and created an event model that ties in to the browser’s DOM. Unfortunately, they created slightly different models, and one browser that shall remain nameless (that one browser that lots of people use but is always a pain for developers) has some nasty memory leaks when using DOM events.

The popular Qt GUI library from Trolltech uses an event model called Signals and Slots. When some kind of event occurs, a “signal” is sent, and the signal is received by “slots.” It’s a simple model, and it’s the one that’s used by MochiKit.Signal.

Even better than ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.