4 ms·
Yep. Nobody ever claimed it wasn't. jQuery adds padding for browsers that don't support certain features or have certain quirks (yes, IE, we're mainly looking
by jvvlimme 13y ago
Yep. Nobody ever claimed it wasn't.
jQuery adds padding for browsers that don't support certain features or have certain quirks (yes, IE, we're mainly looking at you). This is overhead that will slow things down.
That being said, if you can afford to develop for modern browsers only, then by all means, use plain JS.
- masswerk 13y agoThe 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) {... })".)
- bowerbird 13y agoi 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
- jvvlimme 13y agoThat's how jQuery works internally. It checks if function is available in the current browser, if not it will apply a workaround.