{"id":2610,"date":"2025-10-17T13:15:43","date_gmt":"2025-10-17T13:15:43","guid":{"rendered":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2025\/10\/17\/why-i-still-use-jquery\/"},"modified":"2025-10-17T13:15:43","modified_gmt":"2025-10-17T13:15:43","slug":"why-i-still-use-jquery","status":"publish","type":"post","link":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2025\/10\/17\/why-i-still-use-jquery\/","title":{"rendered":"Why I Still Use jQuery"},"content":{"rendered":"<div class=\"wp-block-ponyo-image\"><\/div>\n<p><a href=\"https:\/\/jquery.com\/\" target=\"_blank\">jQuery<\/a> is a household name among web developers who have been around the block. Initially released in 2006, it took the web development world by storm with its easy and intuitive syntax for navigating a document, selecting DOM elements, handling events, and making AJAX requests. At its peak in 2015, jQuery featured on <a href=\"https:\/\/web.archive.org\/web\/20180702093146\/https:\/\/www.maxcdn.com\/blog\/maxscale-jquery\/\" target=\"_blank\">62.7 percent of the top one million websites and 17 percent of all Internet websites<\/a>.<\/p>\n<p>A decade later, jQuery is not the shiny new kid on the block anymore. Most of the original pain points jQuery solved, such as DOM manipulation and inconsistent browser behavior, are gone thanks to modern browser APIs.\u00a0<\/p>\n<p>But jQuery is still widely used. According to <a href=\"https:\/\/www.similarweb.com\/technology\/jquery\/\" target=\"_blank\">SimilarWeb<\/a>, as of August 11, 2025, nearly 195 million websites use it. That means many developers, like me, still use it every day. And like me, you might prefer it in certain cases.\u00a0<\/p>\n<p>So, in this article, I\u2019ll share when it still makes sense to use jQuery and when not. Don\u2019t worry: I\u2019m not arguing we should replace React with jQuery. And I\u2019m not here to romanticize 2008. In 2025, I simply still find myself reaching for jQuery because it\u2019s the right tool for the job.\u00a0<\/p>\n<h2 class=\"wp-block-heading\">A Brief History of jQuery<br \/><\/h2>\n<p>To determine when it makes sense to use jQuery and when not, it helps to know why it was created in the first place and what problems it aimed to solve.<\/p>\n\n<p>When John Resig launched jQuery at BarCamp NYC in January 2006, the web was a different place. Features we take for granted today were absent from most browsers:<\/p>\n\n<p>No querySelectorAll: Selecting DOM elements across browsers was messy. In the mid-2000s, none of the available element selectors, like getElementById or getElementsByClassName, could select elements using complex CSS queries.<\/p>\n<p>Inconsistent event handling: addEventListener wasn\u2019t universal. While browsers like Firefox, Safari, and Chrome supported the W3C event model with addEventListener, Internet Explorer (before IE9) used Microsoft\u2019s proprietary model with attachEvent. These two models differed from each other in almost all functional aspects.<\/p>\n<p>Different browsers had different APIs for XMLHttpRequest. While browsers like Firefox and Safari offered the familiar XMLHttpRequest, Internet Explorer (before IE7) used ActiveX objects to give JavaScript network capabilities. This meant you had to use a bunch of if-else blocks to make an AJAX request.<\/p>\n<p>CSS manipulation quirks: In the 2000s and early 2010s, many CSS features were implemented inconsistently across browsers, which made it difficult to manipulate CSS with JS.<\/p>\n<p>jQuery solved all of this with a simple, chainable syntax and consistent cross-browser behavior. It offered a streamlined, chainable API for DOM traversal, event handling, and AJAX\u2014far simpler than cross-browser native JavaScript at the time. These features made jQuery become the go-to JavaScript library in the 2010s, powering everything from personal blogs to Fortune 500 sites. In 2012, a <a href=\"https:\/\/www.wired.com\/2012\/08\/survey-finds-jquery-library-running-on-half-of-all-websites\/\" target=\"_blank\">W3Techs survey<\/a> found that jQuery was running on 50 percent of all websites, and by <a href=\"https:\/\/web.archive.org\/web\/20180702093146\/https:\/\/www.maxcdn.com\/blog\/maxscale-jquery\/\" target=\"_blank\">62.7 percent of the top 1M websites used it<\/a>.<\/p>\n\n<h2 class=\"wp-block-heading\">Where jQuery Still Makes Sense<\/h2>\n\n<p>Although jQuery\u2019s glory days are clearly behind us, it still works well in some situations. Here are the scenarios where I still choose jQuery:<\/p>\n\n<h3 class=\"wp-block-heading\">Legacy Projects<\/h3>\n\n<p>Even now in 2025, a W3Techs <a href=\"https:\/\/w3techs.com\/technologies\/overview\/javascript_library\" target=\"_blank\">survey<\/a> shows that jQuery is used in 77.8 percent of the top 10M websites in 2025. This is mostly legacy usage\u2014old apps that use jQuery because switching to a more modern framework is a costly endeavour. This is clear when you look at the version statistics. In a <a href=\"https:\/\/devclass.com\/2023\/11\/02\/jquery-survey-shows-majority-using-unmaintained-versions-but-upgrading-might-not-be-easy\/\" target=\"_blank\">2023 survey<\/a> across 500 organizations, only 44 percent use maintained versions (3.6.0 or newer), while 59 percent run older versions (1.x to 3.5.1)<\/p>\n\n<p>I maintain a few legacy projects like these that were written with jQuery, and I can tell you why they\u2019re still around: they just work. So as the adage goes, \u201cIf it ain\u2019t broke, don\u2019t fix it.\u201d\u00a0<\/p>\n\n<p>Many large enterprises, government sites, corporate intranets, and many WordPress plugins and themes still rely on jQuery. Rewriting these sites to pure JavaScript or a modern framework is a time-consuming, expensive endeavour that can also introduce <a href=\"https:\/\/stackoverflow.com\/q\/67961552\" target=\"_blank\">new challenges and bugs<\/a>. Most of the time, all that effort and risk aren\u2019t worth the relatively small benefits in the short term.<\/p>\n\n<p><em>The truth is this: the codebase I inherited, built in the jQuery era, works. The business logic is robust, the profit margins are healthy, and\u2014most surprisingly\u2014shipping new features feels like slipping into a worn leather jacket: unfashionable, but comfortable.<\/em> &#8211; <a href=\"https:\/\/marc.boisvertdupras.com\/going-back-to-jquery-in-2025\/\" target=\"_blank\">Marc Boisvert-Duprs<\/a><\/p>\n<p>Yes, most jQuery plugins are no longer actively maintained or have been deprecated, so depending on them is a security risk. Abandoned plugins may become incompatible or insecure as browsers continue to evolve. So, legacy projects that use jQuery and jQuery plugins should eventually migrate away from jQuery.<\/p>\n\n<h3 class=\"wp-block-heading\">Quick Prototyping without Build Tools<\/h3>\n\n<p>Developers often need to prototype very simple frontend apps, be it for throwaway demos, internal tools, or proof-of-concept pages. Sometimes the spec may even require a very basic frontend with minimal interactivity (for example, a static page with a simple form and a button).<\/p>\n\n<p>jQuery is a perfect choice for these situations. Simply drop in a &lt;script&gt; tag from a CDN and get animations, DOM manipulation, and AJAX in minutes\u2014no need for npm, bundlers, transpilers, or complicated frameworks with hundreds of dependencies. It\u2019s also great for running quick commands from the DevTools console, especially if you want to experiment with an app.\u00a0<\/p>\n\n<p>But why not use a more modern but lightweight framework like <a href=\"https:\/\/alpinejs.dev\/\" target=\"_blank\">Alpine.js<\/a>? Personally, I\u2019m intimately familiar with jQuery: I\u2019ve used it since the beginning of my web development journey. I love its simplicity and ease of use. The minor improvements a new framework can make in this scenario don\u2019t offset the time spent learning a new tool.<\/p>\n\n<h3 class=\"wp-block-heading\">Complex DOM Manipulation in Different Browser Contexts<\/h3>\n\n<p>Hopefully, you don\u2019t have to support older browsers that lack the standard querySelector, or browsers like Internet Explorer, notorious for their non-standard behavior. Unfortunately, some of us still need to maintain apps that run on these browsers.<\/p>\n\n<p>While native JS is perfectly fine for modern browsers, if you\u2019re building something that has to run on older embedded browsers (think: kiosk software, older enterprise or university intranets, or web apps inside legacy desktop apps), jQuery\u2019s normalization saves you from manual polyfilling, and its CSS selector lets you perform complex DOM manipulations easily.<\/p>\n\n<h3 class=\"wp-block-heading\">Simple Animations without CSS Keyframes<\/h3>\n\n<p>As someone who primarily works with backend apps, I don\u2019t often need to code animations for the frontend. But when I do need to create basic chained animations (fading, sliding, sequencing multiple elements, etc.), jQuery\u2019s .animate()is simpler (and more lightweight) to write than juggling CSS animations and JS event callbacks.<\/p>\n\n<h3 class=\"wp-block-heading\">Simple AJAX with HTML Server Responses<\/h3>\n\n<p>I was recently tasked to make some upgrades to an ancient app with a PHP backend. Imagine my surprise when I discovered that the server returns HTML fragments, and not JSON APIs. In this case, jQuery\u2019s .load() and .html() methods can be simpler and more efficient than writing fetch() boilerplate with DOM parsing.<\/p>\n\n<p>For example, I can extract a DOM element from the results of an AJAX request, and load it into an element like so:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \">\n\/\/ Replace #comments with just the #comments-list from the server response<br \/>\n$(&#8216;#comments&#8217;).load(&#8216;\/article\/1 #comments-list&#8217;);\n<\/div>\n<p>Whereas the same thing in native JS would be:<\/p>\n<div class=\"wp-block-syntaxhighlighter-code \">\nfetch(&#8216;\/article\/1&#8217;)<br \/>\n  .then(res =&gt; res.text())<br \/>\n  .then(html =&gt; {<br \/>\n    const doc = new DOMParser().parseFromString(html, &#8216;text\/html&#8217;);<br \/>\n    const comments = doc.querySelector(&#8216;#comments-list&#8217;);<br \/>\n    document.querySelector(&#8216;#comments&#8217;).innerHTML = comments.outerHTML;<br \/>\n })\n<\/div>\n\n<p>Yes, while the jQuery syntax is more straightforward, both approaches are doing the same thing under the hood, so there\u2019s not a huge performance gain. In the jQuery version, you also have the added overhead of bundling the jQuery library. So, it\u2019s a tradeoff between simplicity and bundle size.<\/p>\n\n<h2 class=\"wp-block-heading\">When You Should Not Use jQuery<\/h2>\n\n<p>While jQuery still makes sense in some situations, there are some cases where I would never use jQuery.<\/p>\n\n<h3 class=\"wp-block-heading\">Building a Modern, Component-Driven Frontend<\/h3>\n\n<p>If I\u2019m building a modern frontend app with lots of reactivity and reusable components, I\u2019d use a modern framework like React or Vue with native features for DOM manipulation.<\/p>\n\n<p>Frameworks like React, Vue, Svelte, or Angular handle DOM rendering in a virtualised way. Direct DOM manipulation with jQuery conflicts with their data-binding approach, causing state mismatches and bugs.\u00a0<\/p>\n\n<p>For example, in React, calling $(&#8216;#el&#8217;).html(&#8216;&#8230;&#8217;) bypasses React\u2019s virtual DOM and React won\u2019t know about the change. This will inevitably lead to bugs that are difficult to diagnose.<\/p>\n\n<h3 class=\"wp-block-heading\">When Simple Vanilla JS Is Enough<\/h3>\n\n<p>Most of jQuery\u2019s once-killer features, such as selectors, AJAX, events, and animations, are now native in JavaScript:<\/p>\n\n<p>document.querySelectorAll() replaces $().<\/p>\n<p>fetch() replaces $.ajax().<\/p>\n<p>element.classList replaces .addClass()\/ .removeClass().<\/p>\n<p>element.animate() handles animations.<\/p>\n<p>If I\u2019m just toggling classes or making a fetch call, adding jQuery is wasteful.<\/p>\n\n<h3 class=\"wp-block-heading\">Targeting Modern Browsers Only<\/h3>\n\n<p>jQuery\u2019s major draw between 2008 and 2015 was its cross-browser compatibility, which was necessary due to quirks in IE6\u2013IE9. It simply wasn\u2019t practical to write browser-specific JS for all the different versions of IE. With jQuery, the quirks were abstracted away.<\/p>\n\n<p>When IE was discontinued, this usefulness is no longer relevant.\u00a0<\/p>\n\n<p>So if the app I\u2019m working on needs to support only modern browsers, I don\u2019t need most of jQuery\u2019s compatibility layer.<\/p>\n\n<h3 class=\"wp-block-heading\">Projects Already Using Modern Tooling<\/h3>\n\n<p>Mixing jQuery and framework code leads to a \u201chybrid monster\u201d that\u2019s difficult to maintain.\u00a0<\/p>\n\n<p>jQuery can conflict with existing frameworks, which can cause hard-to-fix bugs. If my project is already written in another framework, I avoid including jQuery.<\/p>\n\n<h2 class=\"wp-block-heading\">Alternatives to jQuery<\/h2>\n\n<p>Sometimes, I need to use some features of jQuery, but I can\u2019t justify including it in its entirety.\u00a0 Here are some libraries I use in cases like these.\u00a0<\/p>\n\n<h3 class=\"wp-block-heading\">DOM Selection and Traversal<\/h3>\n\n<p>Native DOM API (most common replacement) using document.querySelector() and document.querySelectorAll()<\/p>\n<p><a href=\"https:\/\/github.com\/fabiospampinato\/cash\" target=\"_blank\">Cash<\/a>: jQuery-like API, tiny (~10KB), works with modern browsers<\/p>\n<p><a href=\"https:\/\/zeptojs.com\/\" target=\"_blank\">Zepto.js<\/a>: lightweight jQuery-compatible library for mobile-first projects<\/p>\n<h3 class=\"wp-block-heading\">AJAX\/HTTP Requests<\/h3>\n\n<p>Native fetch() API<\/p>\n<p><a href=\"https:\/\/github.com\/axios\/axios\" target=\"_blank\">Axios<\/a>: promise-based HTTP client with interceptors and JSON handling.<\/p>\n<h3 class=\"wp-block-heading\">Event Handling<\/h3>\n\n<p>Native events using element.addEventListener()<\/p>\n<p><a href=\"https:\/\/github.com\/fregante\/delegate-it\" target=\"_blank\">delegate-it<\/a>: small utility for jQuery-style event delegation<\/p>\n<h3 class=\"wp-block-heading\">Animations<\/h3>\n\n<p>CSS transitions and animations (native, GPU-accelerated)<\/p>\n<p><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Web_Animations_API\" target=\"_blank\">Web Animations API<\/a><\/p>\n<p><a href=\"https:\/\/gsap.com\/\" target=\"_blank\">GSAP<\/a>: Powerful animation library, much more capable than .animate() in jQuery.<\/p>\n<h3 class=\"wp-block-heading\">Utilities<\/h3>\n\n<p>* <a href=\"https:\/\/lodash.com\/\" target=\"_blank\">Lodash<\/a>: collection iteration, object\/array utilities, throttling, debouncing<\/p>\n<p>* <a href=\"https:\/\/day.js.org\/\" target=\"_blank\">Day.js<\/a>: date manipulation in a tiny package (instead of jQuery\u2019s date plugins)<\/p>\n\n<h3 class=\"wp-block-heading\">All-in-One Mini jQuery Replacements<\/h3>\n\n<p>If you still like a single API but want it lighter than jQuery:<\/p>\n\n<p><a href=\"https:\/\/umbrellajs.com\/\" target=\"_blank\">Umbrella JS<\/a>: ~3KB, jQuery-like API<\/p>\n<p><a href=\"https:\/\/blissfuljs.com\/\" target=\"_blank\">Bliss<\/a>: focuses on modern features, syntactic sugar, and chaining<\/p>\n<p><a href=\"https:\/\/github.com\/fabiospampinato\/cash\" target=\"_blank\">Cash<\/a>: as mentioned above, the closest modern equivalent<\/p>\n<h2 class=\"wp-block-heading\">\u00a0jQuery Still Has a Job<\/h2>\n\n<p>In 2025, jQuery isn\u2019t the cutting-edge choice for building complex, highly interactive single-page applications that it was in the 2010s, and that\u2019s perfectly fine. While modern frameworks dominate the headlines, jQuery remains a reliable, well-understood tool that solves the problems it was designed for, simply and effectively.<\/p>\n\n<p>In the end, the \u201cright\u201d tool is the one that meets your project\u2019s needs, and for countless developers and businesses, jQuery continues to be that.<\/p>","protected":false},"excerpt":{"rendered":"<p>jQuery is a household name among web developers who have been around the block. Initially released in 2006, it took [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2610","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/2610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/comments?post=2610"}],"version-history":[{"count":0,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/2610\/revisions"}],"wp:attachment":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media?parent=2610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/categories?post=2610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/tags?post=2610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}