Earlier quoted context omitted.
> This has been rolled into the Javascript document api via document.querySelector, and document.querySelectorAll. Have you actually compared the two methods in a real website? It's like saying why use Ruby when you can use Java. The Javascript document API is super verbose. No thanks.
You don't have to use all of it though, right? You can choose to only only use the applicable parts: eg: ``` $('.container-element') .addClass('active'); // vs document.querySelectorAll('.my-class-selector') .classList.add('active') ``` I use the native APIs all the time, they are not that complicated or overly verbose. Easily memorized with practice IMHO. Also they are all extremely well documented on MDN.
jQuery 3.6.0
61–70 of 292 posts
Re: jQuery 3.6.0
#62Re: jQuery 3.6.0
#63Re: jQuery 3.6.0
#64Do people still use jQuery? I thought the biggest advantage of this library back in the day was css selector access of DOM nodes (back when we only had getElementById, getElementsByClassName, and getElementsByTagName). This has been rolled into the Javascript document api via document.querySelector, and document.querySelectorAll. Also there are browser compatibility issues that jQuery solved but a lot of these are so…
Re: jQuery 3.6.0
#65Do people still use jQuery? I thought the biggest advantage of this library back in the day was css selector access of DOM nodes (back when we only had getElementById, getElementsByClassName, and getElementsByTagName). This has been rolled into the Javascript document api via document.querySelector, and document.querySelectorAll. Also there are browser compatibility issues that jQuery solved but a lot of these are so…
- The API is still more concise than what is built into the browser (Compare the number of lines used here: http://youmightnotneedjquery.com/)
- It is still useful for older browsers that might not support something.
- The API is burned into my brain, it speaks jQuery.
- If I have any issues, Google will usually surface how to use the API faster than the (standards compliant API * can I use it?)
I do use React for UI, but sometimes you have to interact with the DOM; in those cases for larger programs I find jQuery easier to read and write.
Re: jQuery 3.6.0
#66Earlier quoted context omitted.
I never understood why people say “We’ve solved your jQuery problem” by introducing getElementsByClassName() or even querySelector(). When I come back to my older app, $(“.my-class”) is still much nicer. jQuery gets out of the way, the class gets syntax-highlighted, and .focus() can’t create an NPE.
I know it doesn't replace jQuery, but this is fairly straightforward: $ = document.querySelector.bind(document) $$ = document.querySelectorAll.bind(document)
Re: jQuery 3.6.0
#67For those wondering, JQuery is still used on the majority of web sites in the world apparently [1] I'm not sure how the data is run, but it's quite massive share however you cut it. JQuery is still in it's foundational phase, it's still a 'core' thing, it's not remotely legacy yet. [1] https://almanac.httparchive.org/en/2019/javascript
A lot of them are probably due to Bootstrap (<5.0) bundling it.
Re: jQuery 3.6.0
#68Do people still use jQuery? I thought the biggest advantage of this library back in the day was css selector access of DOM nodes (back when we only had getElementById, getElementsByClassName, and getElementsByTagName). This has been rolled into the Javascript document api via document.querySelector, and document.querySelectorAll. Also there are browser compatibility issues that jQuery solved but a lot of these are so…
> This has been rolled into the Javascript document api via document.querySelector, and document.querySelectorAll. Have you actually compared the two methods in a real website? It's like saying why use Ruby when you can use Java. The Javascript document API is super verbose. No thanks.
Can't say I've ever heard that as an issue before..
Also I think the main point was there are so many better frameworks that manage the DOM better than jQuery as the need has evolved. I'll always have fond memories of jQuery but I don't see it as my go-to anymore, by a long shot.
Re: jQuery 3.6.0
#69Earlier quoted context omitted.
I think a lot! For example, the new https://www.whitehouse.gov uses jQuery. When you just want to add a small bit of interaction to a mostly-static site, jQuery can help. There's a current trend to complicate things with a JAM stack that really don't need to be complicated. I've seen people propose something like [NodeJS/Ruby/PHP backend] -> GraphQL API -> React Frontend -> static html Where really they could have ju…
> When you just want to add a small bit of interaction to a mostly-static site Then I'd reach for Alpine. Very lightweight, and I can use the fetch API instead of $.ajax.
Re: jQuery 3.6.0
#70Do people still use jQuery? I thought the biggest advantage of this library back in the day was css selector access of DOM nodes (back when we only had getElementById, getElementsByClassName, and getElementsByTagName). This has been rolled into the Javascript document api via document.querySelector, and document.querySelectorAll. Also there are browser compatibility issues that jQuery solved but a lot of these are so…
I think a lot! For example, the new https://www.whitehouse.gov uses jQuery. When you just want to add a small bit of interaction to a mostly-static site, jQuery can help. There's a current trend to complicate things with a JAM stack that really don't need to be complicated. I've seen people propose something like [NodeJS/Ruby/PHP backend] -> GraphQL API -> React Frontend -> static html Where really they could have ju…