Ah ok. Yes, now I see, that's the difference. After many years of writing mootools programs I finally got the real meaning of 'withEvent' :)))) The fact that also the event object is passed along with other arguments.
Thank you On 4 Nov, 16:58, Aaron Newton <[email protected]> wrote: > bindWithEvent would have let you do this: > > myElement.addEvent('click', myFunction.bindWithEvent(this, [foo, bar]); > > myFunction = function(event, foo, bar){ > ... > > }; > > To achieve the same thing, you must do this: > > myElement.addEvent('click', function(event){ > myFunction(event, foo, bar); > > }.bind(this)); > On Thu, Nov 4, 2010 at 8:22 AM, stratboy <[email protected]> wrote: > > Hi. I see that bindWithEvent is deprecated. ok. I also see this > > example: > > > myElement.addEvent('click', function(e){ > > myFunction.bind(bind, [e]); > > }); > > > ok. But I tried this instead: > > > myElement.addEvent('click', function(e){ > > [...] > > }.bind(this)); > > > And it seems to work. What's wrong? > > > Thank you
