Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@happycrappie I know, that was my reaction too when I first started using jQuery. It wasn't love at first sight, but now I can't imagine life without jQuery.
-
@TerriToniAX I acknowledge its power... I've just had to Refactor too much shitty code
-
l0om17167y@TerriToniAX First of all, I didn't mean to be rude. If jQuery gets the job done for you, then use jQuery. But, since you asked, I'd say: most uses of jQuery are DOM nodes selection, class & attributes manipulation, Ajax calls & animations.
When I was using jQuery, a couple of years ago, I thought $ saved me a lot of time and keystrokes, but in fact, it didn't.
+For DOM selection:
$(selector) can be replaced by document.querySelector(selector) or document.querySelectorAll(selector)
+For class & attr. manipulation:
$node.addClass('class') is the same as node.classList.add('class')
$node.attr('id', 'newId') is equal to node.id = newId
$node.is(':checked') equals node.checked
+For Ajax: Take a look at: https://blog.garstasio.com/you-dont...
+$.animate() can be replaced by CSS animations + proper class manipulation.
Also, even if you don't want to overkill things with Angular or React, take a look at Vue.js https://vuejs.org/v2/guide/
:) -
@jordinebot It's cool, I didn't think you were rude :) Yep, all that jQuery does can of course be done with traditional Javascript. But I still find that jQuery comes in handy, that it saves me typing and that my code looks better with it than without it. Thanks for the tip, I'll definitively have a look at Vue.js.
-
l0om17167y@TerriToniAX Take a look at this screencast https://laracasts.com/series/... for a great first approach to Vue
Related Rants
jQuery, because it's a bless when developing web apps.
undefined
wk56