¡@

Home 

2014/10/16 ¤W¤È 12:02:45

jquery Programming Glossary: customevent

Jquery Observer pattern

http://stackoverflow.com/questions/12590091/jquery-observer-pattern

custom event callbacks for the observers observer1.bind 'customEvent' function contextData Some code observer1.bind 'anotherCustomEvent'.. function contextData Some code observer2.bind 'customEvent' function contextData Some code The following line would then.. Some code The following line would then trigger the customEvent callbacks of both observers subject.trigger 'customEvent' contextData..

Jquery Observer pattern

http://stackoverflow.com/questions/12590091/jquery-observer-pattern

subject observer2.observe subject Define some custom event callbacks for the observers observer1.bind 'customEvent' function contextData Some code observer1.bind 'anotherCustomEvent' function contextData Some code observer2.bind 'customEvent'.. function contextData Some code observer1.bind 'anotherCustomEvent' function contextData Some code observer2.bind 'customEvent' function contextData Some code The following line would then trigger the customEvent callbacks of both observers subject.trigger.. Some code observer2.bind 'customEvent' function contextData Some code The following line would then trigger the customEvent callbacks of both observers subject.trigger 'customEvent' contextData while the following would fire anotherCustomEvent..