Forum Moderators: open
I want to conditionally assign an event, which I do for FF like this (using Prototype):
if (typeof(this.field.onchange) == 'undefined') {
this.field.onchange = this.validate.bindAsEventListener(this);
}
However, this doesn't work in IE, because, according to my debugging, IE sees the typeof this.field.onchange as "object". How do I check if the onchange event has a function assigned? Is there an IE only isFunction() or something like that? If so, I could just put it in a Prototype try{} block.
Thanks much, and sorry for the (probably) stupid question.