Using non-dom elements should work just fine.
You'd rather not use the document as that could lead to unexpected
memory leaks.

--
Ariel Flesler
http://flesler.blogspot.com

On Jan 6, 1:56 pm, Marcus Cavanaugh <marcuscavana...@gmail.com> wrote:
> I noted that firing custom events seems to work on any object, for
> instance:
>
> var myObject = {};
> $(myObject).bind(...)
> $(myObject).triggerHandler(...)
>
> Simon Willison had written a tutorial that mentioned using "document"
> instead for that purpose, and I seem to recall yet another mention of
> using $("*") or something like that.
>
> What is the recommended best practice for custom events? Is it okay to
> bind them to non-DOM javascript objects (and are there any downsides
> to doing so)?

Reply via email to