logoalt Hacker News

CM30 • today at 9:03 PM • 4 replies • view on HN

I'm a tad surprised jQuery still exists, though it's kinda neat it does. Always interesting to see historical projects with less and less modern day relevance get continued like this.

And while most of the use cases for jQuery have long since died out with things like classList, querySelector, etc, I do feel there's probably value in a framework that focuses on minor enhancements to a site rather than being the backbone of the whole thing. Like if you want a React or Angular or Vue equivalent, something like jQuery would be a terrible choice, but a lot of sites are static ones where the only scripting needed would be for minor things like dropdown menus or slideshows, and I can see a modern, lean library like this being a decent choice there.


Replies

chuckadams • today at 9:30 PM

jQuery collections are much much nicer than the incredibly anemic NodeList you get from querySelector, which doesn't even implement a full JS Array. You can set states on every element matching a jQuery selector as if it were a single element. I don't personally use jQuery very often since I prefer declarative components, but if I'm whipping up something imperative like a user script, it's hard to beat jQuery's "lenses for the DOM", as one Haskell programmer put it.

dalemhurley • today at 9:12 PM

There is a heap of indie devs that swear by jQuery and avoid the frameworks like react. Each has their use cases.

➕ show 1 reply
liendolucas • today at 9:08 PM

I would probably use Hyperscript for that use case: https://hyperscript.org/

proneb1rd • today at 9:08 PM

I wonder how many websites on the web still use jquery today

➕ show 1 reply