1

Does jquery/javascript have any event model that you can attach to your objects?

Basically I want an object to have an event, and I want other objects to be able to subscribe to these events?

Blankman
  • 248,432
  • 309
  • 736
  • 1,161

2 Answers2

3

Take a look at these:

Custom events in jQuery? Custom jQuery event

and here:

http://www.reynoldsftw.com/2009/04/custom-events-in-jquery-open-doors-to-complex-behaviors/

Community
  • 1
  • 1
karim79
  • 334,458
  • 66
  • 409
  • 405
1

You can use the bind function for custom events.

Ross
  • 13,870
  • 11
  • 59
  • 89