Yes, it's crappy double- (or triple-, depending on what you need to support) coding, but if you have to support IE, it's the only way to do it.
(BTW, in case anyone's wondering: No, Microsoft did *NOT* fix this in IE7, at least not in the beta that we have installed on one machine at work. There is still no HTMLElement.prototype.addEventListener function, so you have to do feature detection and choose between addEventListener (from the DOM 2 Events spec) and attachEvent with different arguments (the IE non-standard). Sigh. Will they ever learn?) |