On 11/27/06, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Brandon Aaron schrieb:
> > Also don't forget to clear out any added properties to the event
> > object in IE or it will leak.
> >
> That's the problem, therefore I favor the paramter approach. While it is
> no problem to clean up the added data after the handler was called,
> closures could make that ugly. Consider this little example:
>
> $().bind("click", function(event) {
>     // event.bindData is available here
>     $().bind("whatever", function() {
>        // event.bindData is not available!
>     });
> }, {stuff: "foobar});

Interesting. Is binding an event within an event a common use-case? I
think it would be more important to *not* leak memory in IE by just
assigning a var to event.bindData in the first bind call. It seems
completely reasonable that event.bindData would not be available to
the second bind since it is a new event all together.

--
Brandon Aaron

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to