Go to content Go to navigation Go to search


Browse

RSS / Atom

All Articles

Code!

IE sucks sweaty mangina · 2007-04-19 13:55

I swear every time I have to test some of my code on this POS browser it makes me feel like throwing my workstation through the window. (Why use Windows™ when there's a door? har har) Why are there the browsers that everything works with and then IE?

Well maybe this particular problem isn't the worst but it's generated a few hours worth of work. So maybe I should be grateful!

But being the ungrateful code jockey and standards nazi that I am I'm going to have a bit of a bitch and a whinge at IE and wonder at what drugs these guys were coming down from when they wrote it.

Bit of background. I'm doing a Javascript class to SUM() arbitrary rows and columns on a bunch of HTML <input> tags with IDs like "a1" and "e7". You get the idea. Ordinarily one would just attach events to these tags that, when the contents changed, re-calculates the total. Ordinarily, element.addEventListener would be used.

Keep in mind that I said arbitrary before. Meaning I want to be able to SUM any combination of cells including overlapping cells.

IE has an equivalent method, attachEvent but unfortunately it's about as useful as tits on a bull. For good reason: attachEvent's parent object is the document! Basically this means that you can't tell where an event is coming from. When you're trying to do something a bit more complex than change the background colour of your website it's just not on.

What's a hacker to do? write their own event model based on the most supported one, of course. I'll let you know how it goes.

Commenting is closed for this article.

comedy gold Spreadsheet