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
  • 259,732
  • 324
  • 769
  • 1,199

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
  • 339,989
  • 67
  • 413
  • 406
1

You can use the bind function for custom events.

Ross
  • 14,266
  • 12
  • 60
  • 91