Quoted post unavailable.
Gov.uk drops jQuery from their front end
61–70 of 458 posts
Re: Gov.uk drops jQuery from their front end
#62Re: Gov.uk drops jQuery from their front end
#63Eh. Everyone hates on jQuery, but for most informational sites that's really all you need for basic interaction. Speed really isn't bad, and it's so straightforward that it's hard to mis-use at this point. I seem to have way more issues with newer frameworks/SPA if I'm not using chrome with no extensions. Makes me nervous dealing with important stuff like banking or government sites.
For basic interaction, you don't need anything but vanilla JS. Browsers have come a long way since the days where jQuery was almost necessary to deal with all of the minor differences/bugs in various browsers.
Re: Gov.uk drops jQuery from their front end
#64Re: Gov.uk drops jQuery from their front end
#65Tangential, but sometimes I see people say that jQuery is dead/failed. While it's not as popular anymore, I think that's actually the perfect evolution for it. jQuery was making up for browser API shortcomings, and now many of those shortcomings have been addressed and been incorporated into browser APIs (not everything, but quite a bit).
Re: Gov.uk drops jQuery from their front end
#66Earlier quoted context omitted.
Collapsible section? https://developer.mozilla.org/en-US/docs/Web/HTML/Element/de... There's some CSS transition stuff you can add to that to make it lightly animated: https://css-tricks.com/how-to-animate-the-details-element/ Yeah, jQuery might make some things easier, but when possible, using native HTML elements makes things even easier,
Hmm, I would agree that you can do 95%+ of stuff jQuery used to be used for in vanilla js or html/css in a nicer way but animated collapsible divs still require a stupid amount of js to achieve.
Re: Gov.uk drops jQuery from their front end
#67There's almost no point talking about javascript on HN with the amount of anti JS & anti framework rhetoric that happens here
I would give it 5 marks out of 10. It’s decent but not a bastion of good design.
Re: Gov.uk drops jQuery from their front end
#68I still use jQuery for frontend JavaScript when I can. It's so much more efficient than native JavaScript. I can't imagine anyone prefers to write document.getElementById('element').style.display = 'none' rather than $('#element').hide();
Re: Gov.uk drops jQuery from their front end
#69I still use jQuery for frontend JavaScript when I can. It's so much more efficient than native JavaScript. I can't imagine anyone prefers to write document.getElementById('element').style.display = 'none' rather than $('#element').hide();
Re: Gov.uk drops jQuery from their front end
#70Earlier quoted context omitted.
For basic interaction, you don't need anything but vanilla JS. Browsers have come a long way since the days where jQuery was almost necessary to deal with all of the minor differences/bugs in various browsers.
Right. However, jQuery isn't just for cross-browser. It provides a clean API for manipulating the DOM, as this site demonstrates (which is ironic): https://youmightnotneedjquery.com/ Personally, for simple sites, I aim for vanilla JS but use jQuery (cash, actually) where it makes sense - such as working on collections of elements.