Brandon Aaron schrieb:
> I think I prefer the suggestion made by Dave Methvin of using on() and
> un() instead of bind.
>
> $().on('click')
> $().un('click')
>
Thanks Brandon, just forgot to mention that.
> Also maybe event.bind and event.trigger should have 'Data' appended to
> the end to be more clear about what it is.
>
> 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});
--
Jörn Zaefferer
http://bassistance.de
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/