Mention jQuery to any web developer, and you’re sure to get a mix of laughter and disdain. Worst yet, many younger developers might only have a vague idea, if any, of what jQuery is. It is seen as a relic of the past, a time when front-end development was nothing more than a bunch of CSS and JavaScript thrown together to make a website look “cool”.
Front-end development has established itself as a separate discipline within the last decade. What was once an afterthought became an essential building block of the web. In the process. jQuery has been dethroned and its role often forgotten or ridiculed.
Let us all take a minute to remember jQuery, understand its impact and celebrate its legacy.
What did jQuery bring to the table?
Mending the incompatibilities
We take it for granted that things just work across different browsers, but back in the mid-2000s that wasn't always the case. With Internet Explorer reigning over the web, incompatible implementations were the reality of many web developers.
There were multiple ways to send an asynchronous network request. Event handling had its quirks on some browsers. Getting a DOM element's bounds was handled differently as well.
jQuery provided a unified API that checked for and mended those inconsistencies.
Selecting DOM elements
Before the introduction of the Selector API in 2013, selecting DOM elements by anything other than class, ID or tag name wasn't an easy task.
jQuery shipped with its powerful CSS selector engine, later branded as Sizzle. It made it possible to select almost any DOM element using a familiar CSS syntax. It even went on to inspire the standard Selector API.
Out-of-box utilities
jQuery lowered the barrier to entry for many aspects of JavaScript programming and DOM manipulations.
It shipped with a vast array of perks, such as:
- Animation API
- Hiding and showing elements
- Event Delegation
- Chaining of DOM operations
There's a plugin for that
Last and certainly not least, a complex ecosystem of third-party plugins formed around jQuery. From carousels to form error validation and parallax effects, all the cool kids were using a jQuery plugin for that.
Some of those plugins can be considered a precursor to modern web components or components in other JavaScript libraries/frameworks that encapsulate UI and functionality.
Too big to fail?
For many developers, jQuery was synonymous with JavaScript. In fact, many had their first contact with the language using the library. Numerous JavaScript questions on Stack Overflow have answers assuming jQuery is being used.
jQuery was doing too many things at once. It was a hybrid, half-library half-framework, that kept on growing. It powered a large percentage of websites worldwide. Not only that, but it also contributed to the success of many other projects. WordPress, Bootstrap and Backbone.js are just a few examples.
The decline
The decline of jQuery correlates with that of Internet Explorer. The popularity of Firefox and Chrome meant browsers had to adhere closer to web standards. Long gone were the days when browsers would differentiate themselves by shipping proprietary features. Now they had to compete in other areas: performance, stability, security and privacy.
The proliferation of Webkit-based and later Chromium-based browsers gave a large portion of internet users a minimum set of capabilities that web developers could take for granted. While renegades like Safari still exist, the Web has moved on.
With incompatibilities less of an issue, web development moved on to greener pastures. DOM manipulation was no longer enough to create the kind of experiences that the Web wanted to deliver. Projects such as Angular.js, Ember.js and React were showing the world that fully-fledged web application are a reality.
jQuery felt suddenly outdated. While not all that shines is gold and the craze around single-page applications seems to be subsiding, there’s no denying that jQuery couldn’t keep up. Despite attempts at modernising, the writing was on the wall.
The legacy
jQuery is not dead, however. It still powers many websites. As of September 2022, w3techs.com reports that 77.4% of websites worldwide use jQuery. That’s an impressive number, especially compared to a popular library such as React standing at 3% for the same period.
jQuery has had a considerable impact on the Web. Not only did it democratise front-end development, but also inspired numerous projects and successors. Influenced by jQuery and wanting to correct some of its antipatterns, a vast array of libraries and frameworks have emerged and helped shape the landscape of web development.
The best thing that jQuery has given us? It stopped being needed.