On Jun 15, 10:05 pm, [EMAIL PROTECTED] wrote:
> mocambo wrote:
> > $(id).observe('click', this.add( 'name' ).bindAsEventListener(this));
>
> > As we know, event handler passed as argument to handler function.
> > Sample above not correct, but how to add 'name' string argument to
> > handler function?
>
> If you have 1.6, you can do
>
> $(id).observe('click', this.add.bind(this, 'name'));
>
> This will put 'name' in the first parameter to this.add().http://www.prototypejs.org/api/function Function.curry may also be helpful. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
