Hello There,
I am new to JQuery but come from a Flex background, and I am struggling with events in jQuery.
I have the impression that events in jQuery are all bound to the dom. So far all examples I have seen bind to a dom element as in:
I would like to dispatch and recieve events between OOP style classes as in:
- $("p").bind("click", function(e){});
- function MyClass() {
- $(this).bind("onsend", $(this).recieved);
- }
- MyClass.prototype.send = function(){
- $(this).trigger("onsend");
- }
- MyClass.prototype.recieved = function(){
- alert('recieved');
- }
Thanks very much,
- new YAHOO.util.CustomEvent("onDataChange");