I have a function that might either be called explicitly or when an event fires. If it's triggered by an event, I need to ignore a function parameter that might otherwise have a useful value.
Is there a reliable, cross-browser way I can check whether an object is an event?
We've been using this, but realized it doesn't work in IE7 since Event
is undefined:
var view = {
save: function (data) {
if (data.constructor === Event.constructor) {
// It's an event.
}
}
};