Eight Weeks of Prototype: Week 4, Event Handling in Prototype
Checking for Stopped Events
As mentioned in the previous section, if you have multiple event handlers, each of them will still be executed even if you called
Event.stop() at any time. You can, however, check to see if an earlier handler has already stopped the event by reading the
Listing 8 shows an example of doing this. In it, I have defined two different handlers for the
click event, each of which will display an alert box. However, the alert box will only be shown if the event hasn't already been stopped.