If I understand you correctly, you are saying to bind all my events to
the single DOM element "document", correct?  I agree that would be
very fast.

My goal though is for objects that are attached all over the DOM
(expandos) to receive events.  If the events went to "document", how
would I dispatch them on to the desired object?  I would have to
register receiver objects with the code attached to "document" which
would seem to me to be an indirect alternative to just registering
with the sending object, which I was hoping to avoid.

Does anyone know if jquery maintains a list of all bound events?  If
not then what I am asking for is impossible to do efficiently.

Maybe I should check into liveQuery.  I don't understand what
liveQuery does but maybe it will help.

On Dec 15, 7:57 pm, Dave Methvin <[EMAIL PROTECTED]> wrote:
> > Event subscriber:
> > $(subscriber_element).bind("myEvent", function() {
> >     alert("I received an event without subscribing!");
> > });
>
> > Event generator:
>
> > $(*).trigger("myEvent");
>
> > I am concerned though about the performance of $(*).
>
> Couldn't you just $(document).bind("myEvent", ...) for them all and
> then trigger the one document event? That would probably be the
> fastest way.

Reply via email to