Chapter 15.2.1. Getting Started with MochiKit.Signal

The first thing to do is to not use the native browser event application programming interfaces (APIs). This is straightforward: if you catch yourself adding onclick or some other on attribute to an element, stop what you’re doing and call connect, which we talk about in a minute. The same goes for calls on the DOM nodes themselves (addEventListener) and so on. Finally, MochiKit’s own addToCallStack and addLoadEvent functions are tied to traditional DOM events, so avoid those, too. In other words, to get the benefit of Signal (and it’s a big benefit, indeed!), you have to make a break from the past.

To get into using Signal, we start with an example, pictured in Figure 15.1, that shows ...

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.