jQuery Is Used on Half of All Websites

Contributing Editor

According to recent research by W3Techs, jQuery is now used on half of all websites worldwide. The popular JavaScript library has come a long way since John Resig’s Selectors in Javascript blog post in 2005.

Perhaps of more interest is the fact that, of all sites using a JavaScript library, 88.3% opt for jQuery. It’s nearest competitor, MooTools, is far behind with less than 9%.

Bizarrely, 50% of sites using alternative libraries such as MooTools or Prototype also load jQuery. I strongly suspect many of those have been rapidly developed using a plethora of plugins to apply cool effects. Concern for bandwidth or efficiency fall by the wayside; no wonder average page weights have peaked at 1Mb.

Finally, the statistics reveal that webmasters prefer their own hosting. 73.4% load jQuery from the local server. 94.2% of the remaining 26.6% sites put their trust in Google’s CDN.

Why has jQuery become so popular?

One reason is Content Management Systems and bootstrap libraries which include jQuery by default. More than one fifth of all websites are based on WordPress — most will load it.

However, despite its success, jQuery receives a fair amount of criticism. It’s not particularly elegant or well-written. It’s tightly integrated with the DOM which can be slow and inefficient. Animation is better handled by CSS3. It doesn’t use or encourage good programming practices such as OOP or MVC. It gives programmers the misconception they understand JavaScript when they don’t. And the decision to drop IE6, 7 and 8 support in 2013 seems a tad premature.

You know what … none of that matters.

Complaints about jQuery mirror those leveled at PHP. Neither is recognized as being particularly ‘good’, but both get the job done quickly and effectively with the minimum of fuss. jQuery is lightweight. It’s extendible. It has great documentation. It has a huge following. Above all, it has a shallow learning curve and is easy to use.

If I need a JavaScript library, jQuery is my first choice. It’s probably yours too. Congratulations to the development team — and best of luck gaining that next 50% of all sites!

Will jQuery continue its meteoric rise or is it becoming increasingly irrelevant as browsers evolve?

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • http://www.satya-weblog.com Satya Prakash

    It is a library of choice of everyone I met.

    • http://www.optimalworks.net/ Craig Buckler

      You should get out more ;^)

  • http://richardrazo.com Richard

    Q: I’m learning jQuery and with the cons you mentioned in this post what is your favorite JS library that covers most of the pros and has the least amount of cons?

    • http://www.optimalworks.net/ Craig Buckler

      The best JS library is one you’ve written yourself to solve problems which are specific to your project!

      Of course, not everyone has the time or inclination to do that. jQuery is a good all-round solution for website effects. If you’re writing a complex web application, you might prefer something with a little more structure such as backbone.js.

  • http://www.paulund.co.uk Paul

    Surprised with only 26% loading jQuery from CDN. Should get more sites doing it then already cached when going on other sites.

    • Mathias

      Actually, it’s closer to 25% (.266*0.942). :P

    • megasteve4

      Interesting article here regarding whether to CDN or not…. Anti Google – Privacy nuts VS one millisecond gain load speed fanatics. There is an epic saga played out in the comments – only very opinionated people need apply!
      http://encosia.com/3-reasons-why-you-should-let-google-host-jquery-for-you/
      (I’m sitting on the fence ;-)

  • pippo

    There are only two kinds of programming languages: those people always bitch about and those nobody uses.
    —Bjarne Stroustrup—

    This has always been my favorite quote…..

    • http://www.optimalworks.net/ Craig Buckler

      Love it!
      The more a product is used, the more people there are to moan about it. Nothing is ever perfect.

  • http://zenshadow.com/ Trevor Geene

    I think the reason most pre-made code fails is due to poor documentation. This the case for many JS libraries and PHP frameworks alike. Developers develop for other developers, it takes a developer and a creative to market to everyone.

  • http://webninjamobile.com Keithics

    Animation is better handled by CSS3.
    – if jQuery uses CSS3 for animations it wont work in all browsers.

    Complaints about jQuery mirror those leveled at PHP.
    – couldn’t agree more on this!

  • http://www.livescript.co.uk Mark Bailey

    I have lots going on in my website and the library which contains code I wrote ages ago and haven’t tweaked is still alot smaller than jquery. I like it, if most of it is needed. But when I go to a site that just has a slider but includes jquery for it then I would say it’s a complete waste.

    Also, jquery is helping the internet lead to JavaScript only websites. A lot of new developers are becoming less concerned if it doesn’t work without but most things can work with or without. I’m creating a 3D CSS3 maze, and that works without javascript, let alone jquery. It’s javascript library is also a lot smaller than query.

  • Kise S.

    Most complaints against JQuery/PHP are from those who are looking for elegant code not functionality

  • Stevie D

    I have a particular reason to dislike jQuery … at work I have to use a computer that Babbage would have described as “a bit basic”. It runs MS Office absolutely fine, it goes on the internet absolutely fine … until I hit a site with jQuery on it. And then it freezes like an Arctic ice floe in the middle of winter, and won’t thaw for minutes on end (at which point it will recognise the last four clicks, action them and then freeze again).

    Now it may be that this doesn’t happen on every site I go to that uses jQuery, it may be that it’s only certain functions like slideshows that cause this paralysis, but the upshot is that because of some sites’ use of jQuery, I now have to browse with Javascript disabled, and re-enable it for those odd occasions when I come upon a trusted site that needs JS to function properly (oh yes, our sysadmins have disabled the trusted/untrusted settings so I can’t even preset them, I have to do it each and every time).

    And all this palaver, for what? Some fancy-schmancy effect that no-one looks at or cares about except the guy who designed the site. I wouldn’t mind so much if it actually achieved anything useful or beneficial, but it pretty much never is. And that’s why I hate jQuery … because it encourages designers to do completely unnecessary things without a second’s consideration of the impact this can have on visitors.

    • megasteve4

      I don’t think you can blame you having an outdated computer on jQuery… If your computer crawls on the web well upgrade from Win 95. If it would be more to your liking just turn of JavaScript all together and see how much fun the web is then.

  • Eranga Tennakoon

    Personally I would like to avoid the use of jQuery in my web applications. There are two reasons. First one is that the documentation. Some of the libraries (not all) comes with poor documentation, so the effort I have to put is too much in order to get it work. The second reason was the control over it I have. Since the code is not written by me, in case of any, its quite difficult to dig into the code and fix the issues.

    • http://www.optimalworks.net/ Craig Buckler

      jQuery’s documentation is very good. Also, it tends to solve more problems than it causes – especially cross-browser compatibility.

      That said, there’s no substitute for writing your own code. And stringing a jQuery chain together does not make you a JavaScript developer.

  • http://www.verycreative.eu Alexander

    The rest of 50% websites that do not use jQuery are the old ones. Those sites built in the early years of the Internet.

    • http://www.optimalworks.net/ Craig Buckler

      So you’re saying a site requires jQuery to be modern and good? Controversial!

      • Jason

        While I do not have any information on the accuracy of the 50%, I think Alexander’s statement could also be read another way. Instead of saying that “a site requires jQuery to be modern and good” you could instead say “the old sites without jQuery are the ones nobody has bothered to update since the early years of the internet”.

  • http://afterlight.com.au John V.

    I’m a big fan of jQuery because it definitely helps me get a lot of things done very quickly. Yes I could spend time writing my own library, but then I have to maintain and support it across all the sites that I build. The jQuery team very kindly does this for me ;)

    Of course, jQuery isn’t always the right choice, there are definitely other libraries out there (I’m a big fan of using Zepto for mobile sites if you need a DOM library).

    If you’re after building something a little more JavaScript heavy (maybe with some MVC-ishness) I tend to head toward Backbone there (becoming a bigger fan the more I use it).

    For some general purpose stuff I get Underscore to help me out.

  • http://www.lunadesign.org awasson

    I’ve been a jQuery convert for a while now (3 – 4 years)…

    At first I figured I didn’t need some AJAX nonsense my own tiny DHTML JavaScript library was all I needed; it was fast and sort of xbrowser compatible and I wrote it so I knew how it worked. Then I had to get my feet wet troubleshooting someone else’s jQuery and it blew my mind how easy it was to use. Add to that the decent documentation and examples and I was sold.

  • Ari

    The trick to using jQuery, is just knowing when to use it, if i need JavaScript to do a few small enhancements to my site such as changing a css class on an event or even just sending a form using ajax, I’m not going to load in the jQuery library just so i can use some fancy ajax function or traverse the DOM with next rather than document.getElementById, if anything i would use my own JS library appropriately named JSLibrary.js, no i would use jQuery if i wanted to execute a complex animation using a easing effect of easeInOutBounce without retaking linear algebra again or if i wanted to add a UI element like an accordion or slideshow, something necessary that would take a while to write in plain old JavaScript. Basically I think that jQuery should only be used when it saves the developer time and dramatically improves the user experience without sacrificing loading time.

  • http://astronautweb.co/ Tim Holt

    I love things that make my life easier. jQuery is one of those things.

    Hooray for all the criticism; it means the jQuery team know what improvements/bug fixes to prioritise thus making each version even better.

  • http://www.e-sushi.net/ Mike Edward Moras (e-sushi™)

    “Complaints about jQuery mirror those leveled at PHP. Neither is recognized as being particularly ‘good’, but both get the job done quickly and effectively with the minimum of fuss. ”

    What on Earth made you compare a server-side scripting language with a javascript ‘helper’ library? There’s more than an abyss or differences between both.

    Even when oranges and civilizations both tend to decay, they still are something completely different.

    • http://www.optimalworks.net/ Craig Buckler

      I wasn’t comparing PHP and jQuery as technologies — only that you hear similar arguments against both.