Menu

11 Things You Might Not Know About jQuery

jQuery was released 9 years ago. Since then, the open source project has made an immeasurable impact in the world of web development.

It’s fascinating to look into the origins of an open source project as big as jQuery.

And no one can give us a more insightful tour of the project’s source code better than the guy who created it, John Resig.

Resig recently annotated the first known copy of jQuery’s source code. In doing so, he offers up a unique perspective on the project’s simple beginnings.

Below are some jQuery facts I learned from reading Resig’s source code commentary.

1. jQuery was originally called JSelect.

But the jselect.com domain name wasn’t available, so JQuery it was.

(The name capitalization changed to “jQuery” later on.)

Source

2. Oddly, jQuery had a Creative Commons license.

Creative Commons (CC) licensing is most associated with creative works. Stock photos, PSD templates, icon sets, UI kits, the like.

But CC licenses aren’t well-suited for open source code. Or, rather, there were better open source licensing options, even at the time jQuery was released.

Even the folks at Creative Commons recommend that we use free and open source licensing such as MIT or GPL for software. The Open Source Initiative, an organization dedicated to promoting open source software, is against releasing open source code under certain Creative Commons licenses.

Resig acknowledges that using a CC Attribution-ShareAlike license for jQuery was a “poor choice.”

The project’s licensing switched to the MIT license soon after.

Source

3. jQuery was created without a version control system.

Today it would be unimaginable for an open source project to be released without using a version control system (VCS) such as Git. Like, how would you even post it up on GitHub?

But the founder of jQuery didn’t use a VCS while developing the initial source code of the project.

To be fair: not using a VCS — even on big projects — was common during the time jQuery was released.

The jQuery project eventually started using version control (it went with SVN) only after Resig received contributions to his JS library.

Source

4. The jQuery name was “stolen” from another project.

“jQuery” was also the name of a Java SQL library. But Resig only found out about the naming-conflict later on, after he was contacted by the project owners of the Java library.

Resig said that he “felt bad,” and he “definitely wanted to avoid causing any confusion”.

I’m chalking this one up as an innocent oversight.

Source

5. jQuery launched in New York City.

The public debut of jQuery was in January 14, 2006 at BarCamp NYC.

BarCamp is a conference centered around technology; mostly Web and open source technologies.

Source

6. jQuery was heavily inspired by other open source projects.

Throughout his annotation, Resig mentions the following projects as being instrumentally influential in the development of jQuery:

The only one still active is Prototype. The latest version of Prototype shipped about a year ago (v1.7.2).

The others on the list are no longer being developed. XPath reached W3C Recommendation status way back in 1999. Unlike HTML and CSS, newer standards haven’t been developed for it.

7. The first jQuery plugin is “JSON for jQuery”.

Created by Michael Geary and released on January 25, 2006, JSON for jQuery allowed you to easily request and output JSON data. By default, the plugin is also the first demonstration of jQuery’s potently powerful extensibility.

The Plugin API is one of the reasons why jQuery is so successful.

Source

8. JSLint was used for jQuery’s quality control.

Throughout the original jQuery source code, Resig highlights some of the not-so-good JS in it, such as “gnarly” regular expressions. (His code-quality standards is much higher than mere mortals like me.) Resig says these were all eventually addressed using JSLint, a popular code analysis tool.

Source

9. jQuery didn’t have any Ajax functionality.

Asynchronous web apps were all the rage in the early- to mid-2000s.

Nowadays, all web apps are expected to be async-capable. It’s nothing special.

But, back then, it was a truly revolutionary concept.

All web developers at the time were jumping on the bandwagon. We all wanted to avoid reloading the entire page just to update a tiny portion of the DOM.

But jQuery strangely did not come with any Ajax helper methods in the first release.

Source

10. jQuery didn’t use curly braces if it didn’t have to. (You know who else didn’t used curly braces back then? Chuck Norris.)

It’s a conventional best-practice to always use curly braces for block statements, even if JavaScript makes them optional in some cases.

Using curly braces prevents mistakes. Especially in teams. If you ran your scripts through a code analysis tool like JSLint, it will complain about your missing curly braces.

But the jQuery project originally preferred omitting optional curly braces.

“I really dis-liked having unnecessary braces,” Resig explains. “This …unfortunate… style preference plagued us for quite a while and caused all sorts of avoidable logic errors.”

So in the first version of jQuery, you’ll find code such as this:

if ( !b )
  for ( var j in a )
    this.style[j] = a[j];
else
  this.style[a] = b;

With curly braces, the above would be written as:

if ( !b ) {
  for ( var j in a ) {
    this.style[j] = a[j];
  }
}
else {
  this.style[a] = b;
}

Source

Side note: I was also a fan of not using curly braces if I didn’t have to. At the time, I thought it was easier to read. No, honestly, it was because going sans curly-braces resembled the syntax of a cool, new web app development framework that released around that time.

11. The core jQuery methods are timeless.

Your favorite jQuery methods such as .css(), .toggle(), .show(), and .hide() are still supported in the API. Even with massive additions to jQuery’s API, no breaking change was ever introduced to them after almost a decade. “There’s a strong chance that you could take circa-2006 jQuery-using code and drop in a modern version and have it still work,” says Resig.

Source

This one you already know:

jQuery makes web development easier.

What first drew me to jQuery was its syntax. I remember thinking how concise and straightforward it was.

Selecting and operating on the DOM only took a few lines of code because of the way the $() function worked. You didn’t have to instantiate an object to hold your selected elements, loop through the object, and bind event listeners on each element in the object. You could chain your DOM selection to as many methods as you wanted in just one statement. To think that this was a feature in jQuery right from the start is just mind-blowing.

I remember when jQuery first came out. I think I was using Prototype + moo.fx. Or maybe it was Dojo. Or maybe Prototype + script.aculo.us. I really can’t recall, since it feels like I used them all.

For sure, at some point, I settled on MooTools. I adored MooTools. I even wrote a book about it. (To the two people who bought the MooTools book: Thanks, Mom and Dad, you’re awesome. You’ve always been supportive.)

But, admittedly, I was getting stuff done much quicker with jQuery. Also, it was easier for me to get less-experienced devs on board with jQuery because of its intuitive syntax and concepts compared to Protoype, Dojo, or GWT.

jQuery played nice with other libraries, recognizing the trend that modern web development techniques were heading towards the reliance on many third-party project dependencies.

As I read through John Resig’s annotation, it quickly became apparent to me that ease-of-use was a foundational philosophy baked right into the project since day #1.

You’ll find commentary in the annotated jQuery source code such as these:

Also, jQuery was one of the few open source projects that stressed the importance of good, user-friendly documentation. This notion was almost counter-culture in that era of open source and web development. The line of thinking back then seemed to be along the lines of “You’re a developer. Figure it out.”

An open source tool for developers in the mid-2000s. And it had the developer’s UX in mind? Seriously? That was outlandish.

jQuery’s user-friendly philosophy is what made it very appealing to regular web developers like me.

And if you look at the biggest, most successful OS projects right now — Bootstrap, WordPress, Sass, Chrome (which even ships with developer tools right off the bat) — this idea of making things easier for developers is a unifying commonality among them.

jQuery is more than just a tool that helped us build sites and shaved off months from our dev processes.

jQuery’s greatest achievement is not that it’s used on millions of sites. That’s just an incidental outcome.

For me, the greatest thing about jQuery — and it’s something I already knew way before reading the annotated version — is this little, 83kb JS library led massively monumental changes in open source culture and the web development industry.

I’m not quite sure that was what John Resig set out to do.

But I also don’t think he really had any say on the matter after releasing his humble JavaScript library nine years ago in BarCampNYC.

Resig created 40 comments on jQuery’s source code. See all of it here: Annotated jQuery Release. Also, you might want to read his blog post about the annotation. Additionally, to find more interesting jQuery facts, read the project’s official History docs.

Jacob Gube is the founder of Six Revisions. He’s a front-end developer. Connect with him on Twitter and Facebook.

This was published on Apr 13, 2015

9 Comments

Teelah Apr 13 2015

Here I was thinking I thought I knew everything about jQuery. Thank you for this information, it was very helpful & great to know.

Linnk Apr 14 2015

Eventually, moo.fx became Mootools. And to me is still the best javascript framework out there. Tho, I have to admit the community is small unlike jQuery’s community.

Sandeep duve Apr 14 2015

Hi
It is nice article you have written, on Jquery , very helpful and useful.
Please keep it up buddy.
Thanks.

Gestor Financeiro Apr 14 2015

i guess that jquery is amazing but your UI(jquery UI) are losing for the Bootstrap.
i know that exist thousand of widgets that also are good.
your article is very enlightening.

Ehsan Gazar Apr 19 2015

These information are so wonderful.
Thanks.

space Apr 23 2015

Hi, can anyone suggest me if jquery and javascript can be used both at the frontend and backend?

    Venkateswaran Jun 05 2015

    You can use Javascript in both frontend and backend (NodeJS). About jQuery, you can only bind it with JS in frontend.

space Apr 24 2015

Hi all, Before posting a question here i tried to find an answer for the goal which i want to achieve. But, none of the research gave an answer to my requirement. So, hoping i could find an answer from the experts of this forum here is my question.

Firstly, i am not a core web developer who can code a program to develop a web application. But, i want to develop an idea into web application which is a common platform for service provider and service receiver. Since i am ameteur could anyone suggest me which scripting language (technologies) do i have to use at the front-end and at the back end considering its future scalability, reliability and development. Also I am very well aware that this is a controversial question, and that it depends on developers preferences. However, I need something to begin with, and I need something with a lots of online support and which is open source. From present perspective, PHP and JavaScript seems to me as the best choice. Please confirm.

Also, i would like to know what is the most suitable **framework** to use if any technology is chosen. I know that it depends on the size of application we are developing. But, still i am looking for expert suggestion. I want to know on which machine to develop a application ( i have windows in my mind).

And lastly, i want to know ho to deploy an application which has integration of API’s ( a payment gateway, google maps). I want to see my application going live in next 4 month (i.e., launch by last week of August 2015).

looking for your answers!!

Teelah May 01 2015

These are some really interesting facts, this is my favorite: 10. jQuery didn’t use curly braces if it didn’t have to.

This comment section is closed. Please contact us if you have important new information about this post.

Partners