You might not not need jQuery

Are you developing a library?


Did you read the second paragraph on that site?

Because you're probably not, so be careful of confusing yourself. The site is useful to understand what jQuery is doing and one of many starting points to get further into JavaScript after using jQuery.

You can still use jQuery on your mum's website. And your clients. See the HN thread on that site.

A better thought would be that you might not need that jQuery plugin.


Then that site has a good message for you.

Take a look at headroom.js which is an example of a good widget. There's a vanilla JS default, a jQuery/Zepto and Angular options. It's nice when you use things that just work out of the box.

Don't reinvent the wheel

You might not need jQuery is not the same as you don't need jQuery. Do you really want to spend your time testing your simpler selector rather than working on other stuff?

Don't forget about other ways of doing things, like only animating with CSS. Much the same as not creating rounded corners using images.

You might not need to support older browsers, in which case use a library that doesn't have old browser support. Like Zepto. Or jQuery 2. Don't get stuck scaling.

Using a (slightly) smaller different library with a similar syntax means you can switch library more easily if more extensive browser or feature support is needed during a project lifetime.

The questions the questions

But I don't want to lump everything in document.ready()
If your JS is at the bottom of the page, by the time the browser gets to it the rest of the DOM has loaded, the document is indeed ready so you don't need this.
But I don't use xx feature (ie dblclick)
But you do use yy feature, which shares a bunch of stuff with xx feature in the code.
Oh my gods the filesize! the jpeg you just added. Think of all the other libraries you could have added instead
I still don't want to use jQuery
Well, that's fine. No one is telling you what to do. You might not need a computer built after 1992. You might not need the toilet right after reading this.
Fork me on GitHub