4 ms·
You might not need jQuery
- deleted 2y ago[deleted]
- jraph 2y agoI didn't know about Element.before, Element.replaceWith and Node.contains… despite them being around for quite some time! Would have saved me from writing some clunkier code than necessary. We may need a "You might not need React" website now.
- darepublic 2y agoJquery stopped being cool about nine years ago
- pier25 2y agoMost of the examples need at least 5x the code compared to jQuery. You will inevitably end up encapsulating those in your own functions at which point why not just use jQuery for this type of DOM manipulation?
- edflsafoiewq 2y ago>jQuery and its cousins are great, and by all means use them if it makes it easier to develop your application. >If you're developing a library on the other hand, please take a moment to consider if you actually need jQuery as a dependency. Maybe you can include a few lines of utility code, and forgo the requirement. If you're only targeting more modern browsers, you might not need anything more than what the browser ships with.
- morbicer 2y agojQuery is needlessly bloated. I have no use for it but if I really wanted sth like jq I would pick Cash or Zepto.
- rchaud 2y agoThe minified jQuery script at 70KB is smaller than most images on an average website.