4 ms·
So when those new native api functions arrive, jQuery will start using them and gain some performance boost (using native vs. custom js code) while at the same
by Khao 12y ago
So when those new native api functions arrive, jQuery will start using them and gain some performance boost (using native vs. custom js code) while at the same time remaining backwards compatible (by doing feature detection). No one wants to write their own feature detection code so this whole page about using native apis is instead of jQuery is ridiculous.
If the point of that website was to educate people on the apis that jQuery calls under the hood, it chose a really poor name.
- kyllo 12y agoExactly. "No one wants to write their own feature detection code" is the whole point of jQuery.
- rip747 12y agoYou hit the nail on the head.
- aplummer 12y agoThis a thousand times, I know with $.trim it will use trim() for good browsers and then whatever hack effort was necessary for IE8. It would be devastating to have to write this manually.
- malandrew 12y agoOr you could use the class list polyfill.
- organsnyder 12y agoIf that's all you need, then that would be fine. However, for most projects you end up needing many other such polyfills, to the point that you might as well use one library—jQuery—to provide them all (plus a lot of other functionality).