You might not need jQuery #javascript

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

jQuery was the king in it's time. Awesome libraries were built with jQuery.

rahulxcr
Автор

I think addEventListener returns undefined, and to actually remove listener you need to do something like
function handle(e) {}
element.addEventListener("click", handle)
And then
element.removeEventListener("click", handle)

kyow
Автор

Pretty much the whole time you could replace jquery with that plain js... jquery still resulted in simpler and more readable code and handled some compatibility details so you dont have to.

technolus
Автор

Jquery is still insanely good and useful because of big community, TONS of plugins and libs based on it and some cool easy features like :contains, ajax etc.

yalmeme
Автор

Vue replaced jQuery for me, but now Svelte replaced Vue for me.

OzzyTheGiant
Автор

To effectively use libraries such as jQuery or React, it is important to first learn the language and have a solid understanding of its fundamentals.

rign_
Автор

You can do all those stuff in a neat way using JQ..
I won't mind including it in my code it's not of a big deal though

sam-nczv
Автор

Skimming through jQuery's source code gave me a good impression of how fragmented and immature the frontend ecosystem was at the time. Borderline angry comments about weird workarounds they had to come up with for old or exotic browsers and stupid vendor prefixes

Nekroido
Автор

jQuery wins when traversing the DOM especially nested deep. Haven't used jQuery for like 3 years now. Moved to Vue and write Modern JavaScript instead.

davidmutua
Автор

After few years with TS, React, I avoid JQuery wherever

simonjanca
Автор

Me who has been using React and Vue exclusively for the past 5 years: huh, interesting.

Tork
Автор

What about the animation that jQuery provides, it's comparatively easy

shaileshjaiswar
Автор

I don't think Vanilla JS is simpler than jQuery. If you're considering replacing jQuery with another library, I believe that using a front-end framework like React or Vue would be the best choice

minhthungo
Автор

It is just faster to type out $() in stead of document.querySelector() even with autocomplete

guestguest
Автор

but JQuery is based on this principle. They just make it shorter.
In fact I would argue that querySelector is the basis of JQuery

asagiai
Автор

This dude just taught us JQuery haha. Now let’s just add all those methods to the “element” element so we can use fakeQuery instead 😂

Synderesis
Автор

Jquery still alive and kicking my friend

ER-kzdp
Автор

How about ajax ? Do you have easy way in js

WaliaIbex
Автор

display = none causes layout shift, you can use display = invisible to avoid layoutshift

PostMeridianLyf
Автор

element.classList replaces .addClass / .removeClass and element.dataset replaces .data

tiller