You Don’t Need jQuery


I admit, I’ve been a heavy jQuery user for the last handful of years. One of the first things I would do when starting a new project was make sure that the jQuery library was there. I settled on jQuery because honestly, it’s just simpler than vanilla Javascript. I freely admit that I’m not the most talented web developer in the world, and my Javascript programming abilities leave a lot to be desired. At first, Javascript was confusing, the syntax was frustrating, and I just didn’t enjoy using it – so I looked to jQuery for easy answers to the requirements for my projects. jQuery is incredibly easy to learn and understand, which is why it’s so widely used and supported.

But it’s time to end my marriage to jQuery, and here is why you should too.

Last weekend, I attended WordCamp Minnapolis. One of the sessions I attended was Josh Broton’s talk titled You Don’t Need jQuery. The concept of Josh’s talk wasn’t a new concept to me, but the points he made drove home the importance to me of becoming less dependent on the jQuery library.

I’d like to tackle this topic from both a Developer and a Marketer’s point of view.

Why Developers Don’t Need jQuery

First of all, everyone is doing it. Josh pointed out the internet’s ridiculous obsession with jQuery and using jQuery to solve problems – even those that were easily solvable with simple Javascript. I found a good example after about 10 seconds of searching Stack Overflow.

Javascript Stack Overflow Question

This question was posted to Javascript, and the question matter itself suggests the user is looking for a Javascript solution. The most popular answer makes me laugh.

jQuery Stack Overflow Answer

jQuery to the rescue! Notice the more logical second answer that doesn’t have as many up-votes.

By choosing jQuery over vanilla Javascript, you’re using jQuery as a crutch, and it will prevent you from becoming a better programmer. Sorry for the blunt statement, but tough love is the way to go in this situation.

When you “learn” jQuery, all you’re really doing is memorizing a few quick snippets of code and the jQuery syntax. You are not picking up any Object Oriented Programming skills.

jQuery/Javascript Meme

If you are serious about being a front-end developer, then Javascript is a must. jQuery is useful, and perhaps it’s a good place to start, just don’t use it as a crutch.

Another argument I hear is that jQuery makes the flashy transitions and animations for interactive websites easier, and therefore has it’s purpose in the world. If that is your argument, I’ll just leave this here for you…

What If I Told You CSS Could Do That

If you’d like to learn more about CSS transitions and animations, I write about them regularly.

Why Marketers Don’t Need jQuery

Or better yet, Why Marketers Should Hate jQuery.

I was on board with Josh’s talk before he even said a single word. I’ve been moving towards a more vanilla Javascript development foundation for some time now, and didn’t really need any more convincing. Then, all of a sudden, at a WordPress Developers Seminar, Josh gave some sound and startling marketing advice.

jQuery - Milliseconds Matter

“…250 milliseconds can be the difference between a return customer and an abandoned checkout cart…every 100 milliseconds of latency resulted in a 1% loss of sales…lose 20% of their traffic for each additional 100 milliseconds it takes a page to load.”

Those are some startling numbers that should get the attention of every single marketer on the planet.

If you know anything about how the web works, you probably understand that jQuery is a third-party library that needs to be included in a website in order for it to work properly. The most recent version of jQuery has lost a little weight over its predecessors, but it still weighs in at about 82KB of data. If you host jQuery locally (lots of sites do), every single site visitor’s browser will request, download, and parse the script. Computers and browsers these day are lightning fast…but this still does account for a small chunk of time.

jQuery - Low Hanging Fruit

This means that jQuery alone can “…add roughly 150ms to 1 full second of load time…”

Based on the previous slide from Josh’s presentation, this could result in up to a 10% loss in sales, all because you included jQuery on your website! A 10% loss in sales could mean the difference between keeping your job or not.

The point is…jQuery can add page load time, and with all the optimization we do as marketers, this is another way we can improve the usability and function of our websites.

jQuery Can Be Replaced With Vanilla Javascript and CSS3

After all…jQuery is Javascript.

I won’t rehash every single jQuery function and give you the equivalent vanilla Javascript function to perform the same action, as there are plenty of websites and blogs out there that will do just that. The point I wanted to drive home is that since jQuery is Javascript, anything you can do with jQuery can be done with just vanilla Javascript. jQuery is completely and entirely unnecessary.

All you have to do is learn vanilla Javascript, and possibly freshen up on CSS transitions and animations. It might sound like a lot, and it might take some time, but the ROI of such knowledge will surely be worth it.

So what do you think? Is jQuery something you use on a regular basis, or have you strayed away from it? Do you think that a new developer learning how to program should start with jQuery, or perhaps not even bother learning it at all? I’d like to know your feedback in the comments below.

I’d also like to give another quick shout-out to Josh Broton, who’s presentation prompted this post. I also stole some of the images from his slides. I’m confident he will rain hellfire down on me if this isn’t OK with him, but his slides drove the point home so good, I thought my readers would benefit from them. All credit for the images (and some the quotes) goes to Josh! Check out Josh’s website to learn more about him and see other presentations and talks he’s done. I can vouch, he’s a really smart guy.