12 ms·
10th Anniversary of JQuery
- franze 11y agoa) jQuery is a great piece of beautiful, battleproven code! b) jQuery was necessary for a long time to have (efficent) fun with the DOM (i.e.: my contribution http://www.fullstackoptimization.com/box2d-jquery/ http://www.fullstackoptimization.com/box2d-jquery/ ) c) Damn, I'm glad that the days of jQuery necessity are (nearly) over. It's a ghetto.
- ddoolin 11y agoSomewhat unrelated but reminds me of this: I enjoyed skimming through Resig's personally-annotated version of the first public release of jQuery (annotated April 2015 of the release in 2006 [!]). http://ejohn.org/blog/annotated-version-of-the-original-jquery-release/ http://ejohn.org/blog/annotated-version-of-the-original-jque...
- Mahn 11y agoNot so unrelated since he links to it right in the second paragraph :)
- merqurio 11y agoI personally got into web development with jQuery. Some years I go it was a must, now a days, I find it unnecessary and I don't use it any more. Is this just me or is transition people is doing ??
- savanaly 11y agoI can think of two main areas that jQuery is useful in which have diminished in importance over the years a) smoothed over differences between browsers. With the web being taken more seriously by everyone, the browser implementers are much more careful about all following the same standard so with every year that goes by there are fewer cross browser quirks to worry about (it's still a major pain today though) b) providing convenience methods for manipulating the dom and working with data etc. I think jQuery has less of a role to play since ES5 and ES6 are how javascript is written nowadays and have more advanced features than js did in jquery's heyday. Also, for advanced client side apps, frameworks like angular and ember also provide such features.
- hellofunk 11y agoGoogle Closure also satisfies these, no?
- swang 11y agojQuery was popular because of the cross-browser functionality it offered, since having to read about all the different quirks was a huge time sink. Also being able to use a selector $() to grab DOM nodes was _huge_. So easy and convenient. I think once web apps starting getting larger and larger, jQuery became more and more of a hinderance (since it offered no framework for structuring apps).
- kedean 11y agojQuery was popular because it was easily grokked by people who were more designers than developers. It had lots of competition early on, my favorite being MooTools, many of which were far better designed and had equal cross-browser support. jQuery was simply more accessible to people without a solid programming backgroud. Had the world gone with one of the many other options back in the day, I think we might be in a better place already.
- mattmanser 11y agoI don't see what this adds apart from sour grapes. It would help if you told us what insight we missed about MooTools that would have made the world a better place? Why jQuery has made it such a miserable one?
- kedean 11y agoI'm not trying to be sour, sorry, I'm just pointing out that jQuery didn't win due to some special superiority that it has. It is in no way better than any of the competition that it had in the early days. jQuery works, of course, but it didn't do anything special in terms of functionality or capabilities. It had everything to do with the audience it appealed to early on.
- level3 11y agojQuery's understandability is part of its superiority over MooTools. When I was first looking for a Javascript library years ago, it was better documented than other libraries, it was more readable (particularly method names), and didn't lean towards OOP (I admit I personally hated Java). MooTools and other libraries might possibly be more powerful if you are developing in Javascript in general, but for web development I primarily care about DOM manipulation, and it was much easier to pick up jQuery than anything else at the time. It's a mistake to think that languages should win out simply based on functionality and capabilities, without taking into account things like ease of use and learning curve.
- vlunkr 11y agoI think as we've moved into "web apps" rather than web pages with some dynamic content, jQuery is being replaced by /react/ember/angular/etc. Still a great library that served it's purpose for a long time.
- ufmace 11y agoNot sure about React, Ember, or Angular 2, but Angular 1 actually includes JQuery, albeit in a reduced version IIRC.
- frik 11y agoSuggestion: read his book "Pro JavaScript Techniques" (2006), it explains how JQuery works. Even if you don't use JQuery, one can find several good code snips and advises.
- dominotw 11y agothis is how i learnt javascript. Has to be the most underrated javascript book ever.
- jdonaldson 11y agoI would argue jquery has been more instrumental to the success of the web than javascript. It was the stroke of pragmatic genius riding the back of a half-baked language ( a prototype-based language trying to ape the style/name of Java, solely as a cheap cash in of its popularity).
- wambotron 11y agoI don't think that's accurate (or fair, really). Jquery was one in a list of dozens of libraries that did similar things at that time, but ajax/interactivity had been part of the web mindset for years before jquery existed. Jquery just won the library war.
- swang 11y agoYep, I'm surprised jQuery isn't older, as I do recall using dojo and prototype before 2006. jQuery was a huge timesaver, as was dojo, mootools, prototype, etc and not having at least one of these libraries would have sucked. And although jQuery "won" it could have easily been any other javascript library. Even if these libraries somehow didn't exist, there was tons of cross-browser snippets plastered across the web that dealt with most of the common problems (ajax, event listeners, etc).
- gregmac 11y agoWhat drew me to jQuery over Prototype in particular was the fact you could use css-style selectors to get and operate on several elements at once. This often reduced several lines of code in a loop to a couple chained methods. Prototype first came out in Feb 2005. Dojo 0.1 was Aug 2005, and 1.0 (first stable, after a total rewrite) was Nov 2007. I do remember using Prototype with script.aculo.us and thinking it was pretty neat to add some effects to my server-side-created web apps, but that they'd largely stay server side. The first time I saw jQuery, that was when I thought "Yeah, okay, we can actually start building some serious client-side interactions here" instead of just server-generated HTML pages. jQuery took me from hating (but tolerating) javascript to actually enjoying client-side web development.
- 11y ago
- anindyabd 11y agoSlightly unrelated -- John Resig's "Secrets of the JavaScript Ninja" is such a well-written book. It allowed me to not only understand but also appreciate JavaScript. I believe understanding JavaScript as a functional language is key to being a good JS developer.
- sotojuan 11y agoAnd there's a second edition coming out soon: https://www.manning.com/books/secrets-of-the-javascript-ninja-second-edition https://www.manning.com/books/secrets-of-the-javascript-ninj...
- html5web 11y agoSame day as my birthday!
- pacomerh 11y agoI'm still looking forward for programmatically generating custom jQuery builds from the download page. We Inertially include the whole build for minor things sometimes. Say I want to just use Events, Selector, or Utilities and Ajax.
- swang 11y agoI used this when I only needed the $.ajax part of jQuery: http://projects.jga.me/jquery-builder/ http://projects.jga.me/jquery-builder/
- jordanlev 11y agoIf you aren't aware of Zepto ( http://zeptojs.com/ http://zeptojs.com/ ), you should check it out -- it exists to serve this purpose.
- larrymcp 11y agoTrue... but by pulling jQuery from Google's CDN for example, you theoretically save page-load time anyway. If multiple sites pull from the same CDN, then it's already cached in the user's browser.
- qwertyuiop924 11y agoJQuery is a brilliant library. No, really. It's designed to make DOM manipulations easy, and it does that REALLY well. I'd go so far as to say that it probably has one the the best interfaces of any library ever.
- ohitsdom 11y agoCompletely agree. Strong evidence for this too when you view his link to his annotations on one of the first versions. The API hardly changed.
- qwertyuiop924 11y agoAlso, JQuery is monadic (https://importantshock.wordpress.com/2009/01/18/jquery-is-a-monad/ https://importantshock.wordpress.com/2009/01/18/jquery-is-a-...)
- qwertyuiop924 11y agoOkay, apparently I'm wrong about that.
- dugmartin 11y agoI remember sitting in a tiny conference room at Monster.com during the first Boston BarCamp in 2006 and listening to this kid from RIT give a talk to maybe 15 of us about his new library called jQuery. I think I asked some dumb question about if method chaining allowed for conditionals.
- overcast 11y agoAwesome! Resig was a few years after my time there, but it's always good hearing RIT associated with someone so game changing.
- BinaryIdiot 11y agoSo it's been 10 years of jQuery being a preferred way of interacting with the DOM API...where are the changes to the DOM API to make the DOM easier like jQuery? Sure we got a few new things like querySelectorAll(), etc but nothing that makes things quite as elegant to create as jQuery's API. Why wouldn't the HTML standards committees follow the trend and improve the API? Edit: removed 'chainable' as a descriptor of jQuery's API as I didn't mean to focus on it; was simply just calling its API chainable but it's led to confusion.
- ergothus 11y agoActually, I don't think the chainable API is terribly important. The things that keep jquery alive and well in mind are: * A convenient way to add to the DOM. While SELECTING elements has gotten way better than the Bad Old Days, ADDING elements is still painful. (one element isn't bad, but if you're trying to add, say, a UL with a number of LI elements, it's...tedious.) * A good wrapper for Ajax calls. Not that there aren't better, but jquery has a perfectly good one. Heck, I've jqueryified a page to test calls I'm making outside of jquery because doing a call via console is...tedious. * Promises. We'll soon have them native (and better), but for a long time jquery has been super convenient for this.
- skrebbel 11y agofor HTTP calls from the console, you might appreciate the relatively new fetch api: https://developer.mozilla.org/en/docs/Web/API/Fetch_API https://developer.mozilla.org/en/docs/Web/API/Fetch_API if you ask me, it's impressively well designed. it looks so boring and straight forward yet somehow nearly all "simple" http libraries (not to mention builtins) in nearly all popular languages are more convoluted.
- amirmansour 11y agoI'm really greatfull for the new Fetch API. For now we need to use a pollyfill for it which just uses XHR underneath. Safari and modern versions of IE/Edge are lacking support.
- 11y ago
- k__ 11y agoJQuery got created about 10 months before I started doing professional web-development so it was there for my whole career, but I never used it, I just read a book written by its maker. Till 2011 I had to use a framework that was a bit like GWT in PHP, because the company just had PHP and C coders and no one wanted to pay a switch. 2011 I started with JS and read stuff like "The Good Parts" and "Professional JavaScript". I wrote a JSON-HTTP-API and rewrote the whole UI in ExtJS. Then I took a sabbatical in 2014 where I played around with Crafty, Phaser, D3 and continued my masters degree where I had to use Ember for a few projects. Last year I dropped in a young project that was using React. Funny thing is, all the time JQuery felt really old to me, so I never considered using it.
- EdSharkey 11y agoI started using JQuery in 2007 or 2008, and it helped me put bread on my table for years. Thanks John!
- hammerbrostime 11y agoI remember when it was announced - I just happened to be in the right place at the right time. It was announced in a smallish room, maybe about 25 people. At BarCamp, if I remember how it worked, everyone who showed up was required to talk about a subject. It was as community-driven an event as any I've ever been to. Lots of amateur presenters. There was a guy there that John Resig had shown jQuery to the night before, and the guy was just raving about it. And when John showed off jQuery, it just was damn impressive. Wish I could remember more, its a bit of a hazy memory now! :)
- blhack 11y agoSounds like you weren't the only person in that room who is posting here today: https://news.ycombinator.com/item?id=10903725 https://news.ycombinator.com/item?id=10903725 :)
- ry_ry 11y agoHappy birthday jQuery! It is currently my 3rd most endorsed linkedin skill after 'dressing himself' and 'marking recruiters as spam'. My friends suck.
- ourmandave 11y agoThen we have some great opportunities requiring 15+ years of JQuery experience in your area. As you're able to dress yourself these are not remote roles. =) </spam>
- randomdrake 11y agoThere's a lot of nifty front-end JS frameworks these days, or popular front-end and back-end JS implementations, so I can see how it's easy to miss what made/makes jQuery great. I think that it's hard to truly appreciate jQuery unless you were actually attempting to write code for web applications that dealt with a lot of JavaScript at the time. 2005 and 2006 was a nightmare for writing front-end behavior on web-based applications. This wasn't because JS was particularly awful to write code in. Internet Explorer, the king of browsers at the time, routinely exhibited totally unexpected behavior with little to no tools to discover how to fix things. While this may sound like a personal attack against Internet Explorer, it's the truth of the matter. Other browsers had quirks, but none were as important as the quirks discovered in the most popular browser at the time. The things that you wanted to start doing to make your app "Web 2.0" like transitions, CSS animations, AJAX behavior, big DOM manipulations, and so on, were totally possible with JS. You just had to write a lot of it and pray to whoever you wanted when you went to test it in IE. One of the big catalysts for getting something better than vanilla JS to play with wasn't just to make writing the code more pleasurable, it was to make it easier to GSD. Two camps came out in this regard. You had folks who were abstracting away the JS a lot more, creating more of their own syntax and language for everything; a framework built in JS. Then there were folks like jQuery who were creating what a lot of people considered a library, in that it felt like you were utilizing a lot of the same vanilla JS you knew and loved, but with some wrappers and helpers. I mean, AJAX was a big and cool "aha" moment when you first saw it and played with it. But the first time you got to do things like: * Identify an element without verbosity like document.getElementById() * Attach an onclick to elements reliably and in a cross-browser safe way * Change the color, replace some text, and fade in or shake or whatever was cool at the time in a single line of code that worked everywhere ... things like these were also very, very cool. And because jQuery was well-documented, and didn't change the language and feeling of using a lot of JavaScript too tremendously, it was, and continues to be, an invaluable tool in so many belts. There are tons of good libraries built on top of jQuery that continue to evolve with standards and trends. Overall it's stood the test of time well, and has saved countless hours of development time; two important qualities in great software.
- elliotec 11y agoI strongly believe that jQuery by itself is almost always easier to use than any JS framework or combo of libraries. The fact that these frameworks often are incompatible or at least look down upon jQuery is odd and dare I say disrespectful.
- edko 11y agoIt is incredible that it has "only" been ten years. It somehow feels that it has been around forever.
- sosborn 11y agoI find the relativity of time so interesting. To me it feels like JQuery came out yesterday.
- hoorayimhelping 11y agojQuery is the BMW M3 of libraries. It handles all the hard stuff for you in such a way that when you use it, you look like a superhero capable of anything. It's one of those rare tools that makes almost everyone better at what they do just by the fact that they're using it. And everyone can find a way to use it in their own style. Just a completely brilliant piece of software that has inspired me (and many others) for a decade. I'm still waiting to meet John in real life and thank him out loud for jQuery. One of these days.
- ralmidani 11y agoFrom the perspective of a passionate user of Ember, jQuery is still relevant. The DOM API may be more consistent between browsers today than it was in 2006, but it is still needlessly verbose: document.getElementById(id) vs. $('#' + id) Let's not forget the lack of chainability in DOM element method calls: el = document.getElementById(id) el.method1() el.method2() vs. $('#' + id).method1().method2() Yes--to me at least--conciseness and elegance matter, now more than ever. A better DOM API does not mean the end of jQuery. In a similar vein, ES6 does not spell the end for CoffeeScript.
- bobince 11y agoOn the other hand, `$('#'+id)` fails when the ID contains dot or other characters that have special meaning in a CSS selector, and `$(selector)` is overloaded with `$(html)` causing common XSS injection issues in apps misusing it. jQuery's “Do What I Mean” philosophy jas introduced as many of its own bugs as it ever fixed in browsers; I wish there were a happy medium.
- jpea 11y agoI do love that John's blog doesn't actually use jQuery itself (likely because it's not needed in this instance). Or any javascript for that matter, other than analytics...
- tim333 11y agojQuery is great and conceptually quite simple - select an element of your page and do something to it in a line or two. It's a shame that the React/Angular stuff doesn't have that kind of simplicity. I'm not sure if that's inherent to the problems they deal with or not.
- seivan 11y agoHmm, is there any reason to use jQuery if you handle your DOM with React? I might be missing something. I used to use it for animations and manipulating DOM, but there are decent lighter alternatives now.