Friday, January 20th, 2006

jQuery: another small JavaScript library

Category: JavaScript, Library

jQuery

“We want small libraries. We want them now!”

We have yet another contender in the small JavaScript library realm: jQuery.

Query is a Javascript library that takes this motto to heart: Writing Javascript code should be fun. jQuery acheives this goal by taking common, repetitive, tasks, stripping out all the unnecessary markup, and leaving them short, smart and understandable.

What does jQuery code look like?


$("p.surprise").addClass("ohmy").show("slow");

You will notice some similarities to other JS libs.

The Skinny a.k.a how jQuery rolls

  • jQuery supports CSS 1-3 and basic XPath.
  • jQuery is about 10kb in size.
  • jQuery works in Internet Explorer, Firefox, Safari, and Opera.

Posted by Dion Almaer at 4:32 am
12 Comments

+++--
3.6 rating from 32 votes

12 Comments »

Comments feed TrackBack URI

I can’t see the real source :-/.

Comment by Nir Tayeb — January 20, 2006

If you go to http://jquery.com/src/ you can view the source as it’s broken down to it’s three modules.

Comment by Steven Ametjan — January 20, 2006

Nir: There was a problem with some redirects on the jQuery web site – it should be resolved now – sorry for the trouble!

Comment by John Resig — January 20, 2006

As a note, jQuery is a lot more then another “small JavaScript library”, it’s really designed so that you can write small Javascript code – without any fluff surrounding it – making coding easier, simpler, and faster. jQuery’s competition really isn’t Prototype (or moo.ajax, or anything else) – because they all still use way too much code to get the job done. I really see this as being a whole new realm for Javascript – previously uncharted, and very exciting.

Comment by John Resig — January 20, 2006

John – couldn’t agree more – truly fantastic work here – thank you!

Comment by matt — January 20, 2006

Downloads seem to be broken again. Just a comment, nothing else in the source code.

Comment by Bob Aman — January 20, 2006

Aha! John just IMed me, seems to be an issue with Firefox, the code’s there, just view source.

Comment by Bob Aman — January 20, 2006

Yeah, it seems as if Firefox has trouble rendering really long lines of text – if they don’t have endlines in them. I’m going to find some way to inject some in, even if it does increase the size of the code by a few bytes.

Comment by John Resig — January 20, 2006

I got the code but when I tried to impliment it in my site no luck. I word in the tutorail I did.

Comment by Joshua Weatherspoon — January 21, 2006

[…] http://ajaxian.com/archives/jquery-another-small-javascript-library […]

Pingback by Project :: penkiblog » 本日書籤 (å?·æ‡¶ç‰ˆ) — January 28, 2006

How would I check does element h2#title exists, and if does to set his html to document.title ?
i have this code but it doesn’t work:

if($(“h2#title”)){
document.title = $(“h2#title”).html();
}

Comment by Marijo — May 11, 2006

I am not certain, haven’t check but shouldn’t that be

if($(“h2.title”)) {
….
}

Comment by canen — May 27, 2006

Leave a comment

You must be logged in to post a comment.