Just reuse the same handler for multiple events:
function handler(event) { /* ... */ }
element
.observe('change', handler)
.observe('paste', handler);
If you need to bind, do that first so you're not creating unnecessary
extra functions:
var Thingy = Class.create((function() {
function handler(event) { /* ... */ }
function hookUsUp(element) {
var boundHandler = handler.bind(this);
element
.observe('change', boundHandler)
.observe('paste', boundHandler);
}
return {hookUsUp: hookUsUp};
})());
HTH,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com
> > input value for 'change' and 'paste' events- Скрыть цитируемый текст -
>
> - Показать цитируемый текст -
--
You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.
To post to this group, send email to prototype-s...@googlegroups.com.
To unsubscribe from this group, send email to prototype-scripta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.