3 ms·
> Is this supposed to be making the case ~against~ jQuery? It's supposed to be making a case against jQuery if you're pulling in the whole library just to do t
by Legion 5y ago
> Is this supposed to be making the case ~against~ jQuery?
It's supposed to be making a case against jQuery if you're pulling in the whole library just to do this one thing.
I've always read the site as "here's how to do it in native JS, yes it's uglier, but if you only need this, you can skip pulling in another dependency."
- rchaud 5y agoWe use React, Angular and Vue for websites where 99% of the functionality could be done without monstrosities like CSS-in-JS. Over-engineering websites has been around forever. That's partially why jQuery is modular, letting you pick what you need.This covers the 'use jquery for just this one thing' crowd. And if they're lazy, well, they can hang their heads in shame because they have added an entire 83 KB to the page's initial load time. /s (unless the browser has a CDN cache stored, in which case it wouldn't impact load time at all)
- mvolfik 5y agonote that browsers' cache has recently been changed so that it's isolated for each origin - if you visit a.com which loads jQuery, it doesn't speed up loading jQuery on b.com at all https://developer.mozilla.org/en-US/docs/Web/Privacy/State_Partitioning#network_partitioning https://developer.mozilla.org/en-US/docs/Web/Privacy/State_P...