$(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?
on 2008-06-16 05:34
on 2008-06-16 07:06
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().
on 2008-06-16 20:32
On Jun 15, 10:05 pm, develo...@ckiweb.com wrote: > > This will put 'name' in the first parameter to this.add(). http://www.prototypejs.org/api/function Function.curry may also be helpful.