Why do yo use JavaScript-Libraries like jQuery?
Today, we have our browsers in a who-is-most-standard-compliant-competition and a lot of nice new APIs with most of the basic ones even supported by IE 8, so most of them have higher backwards-compatibility than jQuery 2.x, which officially only supports IE >9.x.
So I asked me: For which reason are most of the web developers using jQuery? I mean: Selecting DOM elements isn't an argument, Element.querySelector should be faster. AJAX complexibility isn't an argument, ActiveXObject is dead since IE 7. Animations aren't an argument, CSS 3 is grown-up. Since ECMAScript 5, there's Array.prototype.forEach. Events can be easily handled by CustomEvent.
If you're interested in these native APIs called WebAPI, just take a visit to MDN: https://developer.mozilla.org/en-US/docs/Web/API/Element.querySelector https://developer.mozilla.org/en-US/docs/Web/API/element https://developer.mozilla.org/en-US/docs/Web/API/Node https://developer.mozilla.org/en-US/docs/Web/API (Everything at a glance)
16 comments
[ 6.9 ms ] story [ 61.6 ms ] threadI think this is actually the remaining argument. JQuery was the best at selecting DOM elements and grew from there. I think the question now is whether you find enough value in the other parts of JQuery to include its (rather massive) .js file.
http://sizzlejs.com/
Also jquery neatly abstracts single/ multiple element operations making for shorter code.
Use jquery 2, it's tiny and gives you the tenseness without the extra code for all the old stuff.
Or cut a few pixels from the top of a single image and save bandwidth that way.
Plugins are not the reason and fortunately it is changing already, because UI/UX feature developers do not want to be jQuery plugin vendors anymore, they want to promote their stuff under their own brand.
Its ubiquity also means that problems are often already solved in it. Every time I've run into a jQuery bug there has been discussion and work-arounds already posted online by people much smarter than myself.