back

by masswerk·12y ago·view on hn ↗
The other (more traditional way) would be to address anything in plain JS and add special code to handle things for IE, rather than piping all browser through some abstraction layer.

(Same applies for other, non-UI-specific JS: Need Array.forEach()? Use it. Define Array.prototype.forEach() for legacy IE, rather than piping all browsers through "MyLib.forEach(myArray, function(item) {... })".)

2 comments
i don't wanna have to check everything i use to see if it has any browser incompatibilities this week...

and i certainly don't want to do the work of figuring how to sidestep incompatibilities that _are_ present.

even if the distastefulness of _that_ was half as bad, i would still rather make my users "wait" for that 37k.

again, that's _me._ not telling anyone else how to do it.

-bowerbird

That's how jQuery works internally. It checks if function is available in the current browser, if not it will apply a workaround.