Re:Htmx is part of the GitHub Accelerator
by rodorgas on Wednesday August 16, 2023 @07:32AM
(#37145486)
JQuery would make sense when we didn’t have querySelector and fetch API. I can’t think of any reason to use it today on a new project, there are not advantages over vanilla.
[ Parent
| on HN ]
Re:Htmx is part of the GitHub Accelerator
by tambourine_man on Wednesday August 16, 2023 @07:41AM
(#37145562)
The native API is much more verbose and less composable. It was a real lost opportunity.
Re:Htmx is part of the GitHub Accelerator
by antiatheist on Wednesday August 16, 2023 @08:01AM
(#37145727)
const $ = document.querySelector.bind(document)
const $$ = document.querySelectorAll.bind(document)
Re:Htmx is part of the GitHub Accelerator
by tambourine_man on Wednesday August 16, 2023 @09:01AM
(#37146412)
Oh, I wish it was that simple.
Re:Htmx is part of the GitHub Accelerator
by synergy20 on Wednesday August 16, 2023 @07:51AM
(#37145651)
jQuery's syntax is 10x better than vanilla javascript
Re:Htmx is part of the GitHub Accelerator
by antiatheist on Wednesday August 16, 2023 @08:07AM
(#37145777)
Bullshit, the jQuery "Ajax" API is a hellish convoluted nightmare with zero consistency.
https://api.jquery.com/category/ajax/
Have you seriously looked at this and thought "yeah thats better than using a single native function (fetch)"?
As for the rest of the API - what would you even use besides the css and selector functions? Which again, the native `classList` and a simple bind to the selectors are simpler and less verbose.