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
>