I visited the homepages of the 14.8 million sites in Google’s Chrome UX Report in October.

I thought jQuery would be dead, but it’s still on 53.7% of sites, and it seems to be tied quite tightly to the platform. Webflow puts it on 97.6% of its sites, WordPress on 84.9%. For contrast, React is on 10.6% of sites.

jQuery helped me get into web development, and I guess it still gets the job done even if redundant with browser standards these days…

  • ultimaluz@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    8 hours ago

    from the agency side, a lot of that 53% is just sites nobody gets paid to touch. clients pay for the new feature or the redesign, not for swapping $() for querySelector on a site that works, and on wordpress some plugin loads it again anyway like OP said. for something new I wouldn’t pick it, but I don’t expect the number to drop fast, it goes down when sites get rebuilt, not when devs stop liking it

  • Azura The Spellkissed@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    14
    ·
    2 days ago

    To be fair, jQuery isn’t bad or outdated. Not everything on the web tries to be a webapp. If you just want to load a comments widget or handle form submission, vanilla js or jQuery can be better than frameworks that add bloat and many moving parts that could break.

    • thewebreport@programming.devOP
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      2 days ago

      Ran some numbers - Core Web Vital pass rates:

      • jQuery, no React - 4.17M sites - 62.2%
      • React, no jQuery - 748k sites - 65.5%

      The jQuery, no React - is mainly WordPress sites, taking that out of the equation:

      • jQuery, no React, not WordPress - 1.75M sites - 72.5%
      • jQuery, no React, WordPress - 2.42M sites - 54.8%

      So outside WordPress, jQuery sites pass more often than React sites.

      INP is where React is worse. INP is the responsiveness metric. 95% of jQuery sites have good INP, against 87% of React sites. Probably the cost of large JS bundles hydrating on load, whereas a small jQuery script costs relatively little.

      And there’s a small group of sites that run both, and predictably perform the worst of the lot with 41.8% pass rate.

      It’s not something we measure ( yet ) but does seem there’s a lot of simple brochure site that really just don’t need react, pre-rendering and a lot of the complexity that comes with it, but maybe that’s a developer convenience / preference.

    • Skullgrid@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      2 days ago

      yeah, I never learnt jquery because it just seems like a re-implementation of shit that is currently supported, but some of it apparently came from jquery.

      did it have a security leak or something?

      • webhead@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        2 days ago

        I dunno but people seem really hell bent on getting rid of it for some reason. I think it’s just that web developers are constantly using some new framework and anything that’s not that they go “ew” like every single website must have the same overblown needs they do lol.

        • doughless@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          1 day ago

          For me, the reason is because everything I used jQuery for is now available in native JavaScript. That said, React is definitely more bloated, so I’m stepping over dollars to pick up pennies.

    • tatterdemalion@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      2 days ago

      Forgive me if I’m off base, because I have not used jquery personally, but from what I’ve read, jQuery is both redundant and has a lot of footguns. I think it’s reasonable for people to discourage its use, especially for new applications that simply don’t need it.

      • Hmm, my instinct tells me to defend myself, but honestly, you are basically right. I meant to say “not everything needs React/…”, but my comment accidentally defended jQuery instead. One cannot really recommend anymore to start developing with jQuery, that’s true. However, I wouldn’t necessarily urge existing websites to move away from it either, it’s not really that nasty. In that regard, my previous comment was confusing. jQuery kinda is outdated, but not dangerously so. There are some footguns, like using selectors with string interpolation with unsafe input (which yeeaars ago could lead to HTML injection, but even now, unsafe input might contain unexpected commas), but I wouldn’t trust the same devs who make those mistakes to make less mistakes with e.g. Angular.

  • DecorativeTarp@lemmy.zip
    link
    fedilink
    arrow-up
    12
    ·
    edit-2
    2 days ago

    Stock Wordpress no longer requires it anywhere on the front end, but the mass of older sites, plugins, and themes are probably still rocking it. (And it’s still deeply embedded in the core/dashboard.)

    • thewebreport@programming.devOP
      link
      fedilink
      arrow-up
      6
      ·
      2 days ago

      Yeah be interested to see if WordPress’s share drops over time. Is painful to optimise a custom theme, light vanilla JS then some plugin enqueues the bloat right back in 🫠

  • Alavi@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    2 days ago

    It’s actually good for some cases. Most things can be done with plain JS now. Unlike people like to admit, JS has become an amazing scripting language for browsers. But jquery can still be useful for some cases. Especially with the new shift-back to MPAs, it can be very useful alongside something like HTMX

  • bitjunkie@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    2 days ago

    I still use bookmarklets to inject it and change data/layout on certain sites. Not as frequently as I used to, mind you, but still. It was pretty ahead of its time.