event called two times
event called two times
Hi,
I've just figured out that trigger maps "on"+funcName. I'm using bind/
trigger (jQuery.event) on objects to do some call delegation.
i.e.:
$({msg:"Hello World!"}).bind("hello", function()
{ alert(this.msg); }).trigger("hello");
but, it can become magical
$({onfoo:function(evt, msg){alert(msg);}}).trigger("foo", ["Hello
World!"]);
onfoo is called automatically. It seems to be a feature but I my case
it was calling the "onfoo" two times because I binded it.
Is that possible to not trigger the "on"+... events if:
val = jQuery.data(elem, "handle").apply( elem, data );
has been fired already?
Thanks,
-- Yoan