Login Register

Events

Key Code Constants

Dojo provides the following keycode constants in the namespace dojo.keys:

Simple Connections with dojo.connect

Dojo provides a pair of functions to handle many of your event-handling needs: dojo.connect and dojo.disconnect. With dojo.connect, you can link one function to fire when another does, handling DOM events and custom functions with a single mechanism. Additionally, dojo.connect allows you to connect as many functions to an event as necessary. With dojo.disconnect, you can cancel a connection, assuming you've kept some reference to it.

Publish and Subscribe Events

In addition to the simple event system created by dojo.connect, dojo offers support for anonymous publication and subscription of objects, via dojo.publish and dojo.subcribe. These methods allow a function to broadcast objects to any other function that has subscribed. This is dojo's topic system, and it makes it very easy to allow separate components to communicate without explicit knowledge of one another's internals.

Page Load / Unload

To perform any DOM scripting, one needs a DOM to work with. Otherwise, you don't have nodes to attach your events to or manipulate, and the results of your program can be undesirable (e.g., no output for no obvious reason, or events attached to the document root).

Syndicate content