internet-explorerdomdom-eventsinternet-explorer-10attachevent

Will IE10 use `addEventListener`, or `attachEvent`?


Will it still be evil and headbangingly frustrating and quirky like the others so far? When are they just going to get with the program, or will they ever? Personally, I hope they don't so that people abandon them for free software sooner, and that way I can use a shorter test:

var addEventListener = !-[1,] ? "attachEvent" : "addEventListener"; instead of testing for the methods themselves each time. Or will IE10 support both?


Solution

  • IE9 uses addEventListener.
    IE8 used XMLHttpRequest.

    By trying to test for "IE-quirks" and then programming around that, you're missing the ability to actually use standard functionality.
    Especially when the quirks you test for have nothing to do with the features you want to use. It doesn't matter if some of the browsers which have those quirks also don't have support for one standard feature or another...
    Because some other browsers don't have the quirk, and don't have the feature...
    ...or do have the feature and still have the quirk.