Backbone Tutorials

Events

Backbone.Events

Events is a module that may be blended in to any object, giving the
object the flexibility to bind and trigger customized named events. Events don’t
need to be declared earlier than they’re sure, and will take handed arguments.
For instance:

var object = {};

_.extend(object, Backbone.Events);

object.on("alert", operate(msg) {
  alert("Triggered " + msg);
});

object.trigger("alert", "an occasion");

For instance, to make a useful occasion dispatcher that may coordinate events
amongst completely different areas of your application: var dispatcher = _.clone(Backbone.Events)