Blog

Blog » jQuery 1.2.2: 2nd Birthday Present

Posted January 15th, 2008 by John Resig

On the 2nd anniversary of jQuery’s release we’re proud to bring you a brand new release of jQuery. This is primarily a bug fix release for jQuery 1.2. You can view the full list of what was fixed on the bug tracker.

Downloading

jQuery 1.2.2:

If you wish to checkout the full release from the Subversion repository, you can do so by following the following instructions and checking out the source from the following location:

svn co http://jqueryjs.googlecode.com/svn/tags/1.2.2

Important Changes

A lot of hard work was put into this release by Brandon Aaron and David Serduke. David is a new addition to the jQuery core development team and has been making significant contributions - please help us in welcoming him!

Primarily, this has been a bug fix and optimization release. We landed over 120 bug fixes and our test suite now has over 1157 tests in it - which we are quire proud of.

300% Speed Improvements to $(DOMElement)

Once again, we’ve taken a step at micro-improving the most-used features in jQuery. Specifically, the use of passing a DOM element into the jQuery function. (Most frequently used when you see stuff like $(this) in your code.)

Here’s a quick peak at some of the speed jumps that you can expect in all the major browsers:

Browser 1.2.1 (ms) 1.2.2 (ms)
Firefox 2 0.041 0.015
Firefox 3 0.033 0.01
Safari 3 0.017 0.005
Opera 9 0.023 0.004
Internet Explorer 6 0.04 0.03

.ready() Overhaul

The document ready function has been long due for some extra love. We’ve made a number of specific changes.

* Internet Explorer document ready drastically improved. We use a new technique inspired by Diego Perini. It allows us to not have to do a document.write() anymore, which is really fantastic.
* All browsers now wait for CSS to be ready, in addition to just the DOM. In reality, it’s not just a vanilla document ready anymore - but we found that users, overwhelmingly, needed to wait for document styling to be active (such as knowing if an element is visible, or what its height is). Specifically we’ve added improvements to Safari and Opera to make this possible.
* $(document).bind("ready", fn); - You can now watch for the document ready event via the traditional .bind() function. Of course, .ready() still works as you would expect it to.

.bind(”mouseenter”) / .bind(”mouseleave”)

The functionality that was the core of the .hover() function has been split out into two new cross-browser events: mouseenter and mouseleave. These are different from mouseover and mouseout as those events will fire as you move in and out of child elements (which is generally not desired). For example, the following are both valid and work perfectly in jQuery 1.2.2:

$("li").hover(function(){
  $(this).addClass("hover");
}, function(){
  $(this).removeClass("hover");
});
$("li").bind("mouseenter", function(){
  $(this).addClass("hover");
}).bind("mouseleave", function(){
  $(this).removeClass("hover");
});

.bind(”mousewheel”)

We have a new plugin, written by Brandon Aaron, based on the new Event API which adds mousewheel event support to jQuery core. This will allow you to write things like:

$("div").bind("mousewheel", function(event, delta){
  if ( delta < 0 )
    $(this).append("up");
  else
    $(this).append("down");
});

Complex :not()

Even though it’s not part of the CSS 3 specification it’s been a common feature request - so you can now do complex expressions in your :not() selectors. For example, the following now work:

$(".hover:not(li.active)")
$("li:not(.active,.hover,:contains(test))")

Accept Headers

For normal jQuery Ajax operations we now send an extra Accept header to let the server know what kind of content we’re looking for. If you specify a dataType argument then we’ll take care of all the header setting for you. We currently send the following headers for each dataType.

  • xml “application/xml, text/xml”
  • html “text/html”
  • script “text/javascript, application/javascript”
  • json “application/json, text/javascript”
  • text “text/plain”
  • Everything else: “*/*”

Bug Fixes

Here’s a sampling of some of the functionality that’s seen some important overhauling.

* .clone() overhaul
* Script evaluation overhaul
* height() / width() overhaul
* Cross-frame DOM manipulation
* A few memory leaks have been resolved

Event API

There’s a new API for dealing with events. You can now create your own custom event types (with custom ways of being set up and torn down). Effectively, it allows you to go beyond simple event triggering and create a full scheme for attaching, handling, and tearing down events on an element. A demonstration plugin was created by Brandon Aaron that you can use to learn the powerful new API.


73 Responses to “jQuery 1.2.2: 2nd Birthday Present”

  1. Riddle Says:

    Wooohoo! Fantastic changelog, thank you jQuery team, happy birthday! This library relieves me on a daily basis from nearly all JS pain I used to have. :) Keep rockin’!

  2. Torsten Says:

    Great news!

    Thanks for all your hard work!

  3. Antonio.Reset Says:

    Wow, great!
    I think it’s time to get to work with some new projects using jQuery!

    Thank you guys!

  4. Chris Says:

    Sweet! Lots of good stuff in this release. Thanks for all your hard work.

    Happy Birthday!

  5. Marco Gomes Says:

    The new Event API and speed improvements to $() are both very good news. We were waiting for a even faster elm selector, now we got that.

    from Brazil, Marco Gomes

  6. jQuery 1.2.2 ha visto la luz | aNieto2K Says:

    […] sobre la función $(), además de otras mejoras tambien interesante. [Descargar] Compártelo # « Analizando el panel de escritura de Wordpress2.5 […]

  7. dom Says:

    Happy Birthday and thank you all for your excellent work.
    Special welcome to David Serduke! :)

  8. Thasmo Says:

    Really, really very nice, waited for a cool new update!
    Thanks to all of you, great work! =o)

  9. Romz Says:

    Awesome !!!!!!
    What a great job guys !
    Congratulations and welcome to David

    Romz : Belgium

  10. paul Says:

    Happy Birthday!

    Can the DOM element passing also gain speed in IE7 (not a major browser?)?

    Isn’t birthday donation day :)

  11. jQuery 1.2.2 发布 at catch the digital flow | 北极冰仔部落格 Says:

    […] (via jQuery Blog) […]

  12. firman Says:

    faster and still 29kb. woo hoo.

  13. Michaël Says:

    Wow, each of your ‘bug fix release’ is always full of new features, not only fixes! :-D
    Thanks a lot for this amazing work! Happy Birthday jQuery!

  14. BillyChow Says:

    Oh yeah…
    Less bug and more speed.
    Happy birthday!

  15. Vlad Says:

    I waiting for this news! ;-)

    Great news!

    Go to updating my site’s ;-) ))

  16. Bram.us » jQuery 1.2.2 Released Says:

    […] New jQuery version released, celebrating the 2nd anniversary, including a 300% speed improvement to $(DomElement) amongst many other things. Huzzah! Spread the word! […]

  17. Ivan Says:

    Yead….very yellow,very powerful…

  18. Felipe Diesel Says:

    Great news. Keep going this way…

  19. Joomla! ¿Qué es Joomla!? | JQuery 1.2.2 Says:

    […] John Resig acaba de anunciar en el blog de desarrolladores la salida de la versión 1.2.2, en el marco de la conmemoración del segundo aniversario del primer lanzamiento de una de las librerías mas utilizada en la actualizada. […]

  20. Bohdan Ganicky Says:

    Clap, clap again. I think this is good time to add “paypal subscribe” button next to the “donate” one. Instead of $10 from time to time, $10 every month. jQuery really deserves it, doesn’t it?

  21. Tane Piper Says:

    Hooray! Another great release, and it looks like another winner :) John, between working on FF3, jQuery and Writing books I don’t know where you get the time :) Congrats to the whole jQuery core team too :)

  22. Snowcore Says:

    jQuery is the best!!!!

    But in new version I often have an error: “handler is not defined”

  23. Happy Birthday jQuery! Version 1.2.2 released « Rip’s Domain Says:

    […] January 15, 2008 Today marks the second birthday for jQuery (my favorite javascript library)! To celebrate, version 1.2.2 has been release. Go check it out! Posted by rip747 Filed in Jquery Tags: javascript, Jquery […]

  24. dc crowley Says:

    thanks guys… jQuery really works for me. Really appreciated and howdie to David Serduke. Thanks for joining up

  25. 博课 Says:

    jQuery 1.22 发布

    1月14日是jQuery

  26. pcdinh Says:

    Thanks for your hard work

  27. b_b Says:

    Happy birthday and thaks a lot !

    We have published a french translation of this post on the french jQuery website :

    http://www.jquery.info/Joyeux-anniversaire-jQuery

  28. Matt Ellsworth Says:

    Happy Birthday and thanks for the update!

  29. jQuery 1.2.2: 2nd Birthday Present « outaTiME Says:

    […] (Via jQuery Blog.) […]

  30. Loïc Hoguin Says:

    Happy birthday, thanks for everything you have given us!

  31. jQuery Minute™ » jQuery 1.2.2 Released Says:

    […] http://jquery.com/blog/2008/01/15/jquery-122-2nd-birthday-present/ […]

  32. Publicado jQuery 1.2.2 « Origen Abierto Weblog Says:

    […] fuente: http://jquery.com/blog/2008/01/15/jquery-122-2nd-birthday-present/ […]

  33. Fusioncube » Blog Archive » jQuery 1.2.2 Released Says:

    […] jQuery 1.2.2 was announced today. Though this is a revision release, it’s a significant one and definitely worth considering an upgrade to your existing jQuery implementations.  If for nothing else, the 300% speed improvement for DOMElement. […]

  34. Ernest Leitch Says:

    Thanks for continuing to work on the best javascript toolkit out there.
    I’ve been using it for awhile and it just keeps getting better.
    It’s helped me reduce so much js code. I’m still on the tip of an iceberg when it comes to knowing all this can do.

    I’ll wait for 1.2.2.1 for any small “opps” bug fixes before I roll it out.

  35. Patrick Wolf Says:

    Great work!

    Patrick

  36. CommentURL.com | A world of interesting web pages Says:

    jQuery: jQuery 1.2.2: 2nd Birthday Present | CommentURL.com

    jquery.com…

  37. Brian Says:

    I love you man!!! You just saved me from hours of IE JavaScript debugging HELL! Thanks so, so much. The jQuery team is top notch!

  38. Infovore » links for 2008-01-15 Says:

    […] jQuery: » jQuery 1.2.2: 2nd Birthday Present New release of jQuery: as usual, it’s a blend of rather impressive performance boosts and some neat new functionality. (tags: javascript library domscripting jquery) […]

  39. Renato Carvalho Says:

    Oh! Thanks again!!!

    Congratulations to entire jQuery team and Happy Birthday :)

  40. batosai Says:

    really nice demo

  41. sunsean Says:

    Excellent additions, I will enjoy this new level of freedom. Thank you

  42. links for 2008-01-16 « Gevã Schaefer Says:

    […] jQuery: » jQuery 1.2.2: 2nd Birthday Present (tags: javascript jquery web development) […]

  43. a work on process » links for 2008-01-16 Says:

    […] jQuery: » jQuery 1.2.2: 2nd Birthday Present It’s always nice having spent a day working on some code to find the key library getting significant speed boosts the next day. (tags: javascript jquery performance) […]

  44. links for 2008-01-16 « Mandarine Says:

    […] jQuery: » jQuery 1.2.2: 2nd Birthday Present (tags: javascript jquery webdev) […]

  45. jQuery 1.2.2 » Code Candies Says:

    […] Während man auf der jQuery Homepage noch hinterherhinkt, kann man hier schon die neue Version 1.2.2 bekommen. […]

  46. [anniversaire] JQuery 1.2.2 pour les 2 ans de JQuery! « Antoine Guiral : apprenti du web 2.0 Says:

    […] Je vous invite à mettre à jour votre version de JQuery! Et si vous voulez en savoir plus c’est par ici. […]

  47. Yereth Says:

    Great work!

    But the getJSON callback is broken when using absolute URLs on local calls.

    For a fix, get this:
    http://www.yereth.nl/js/jquery-1.2.2-yereth.js

    For discussing it, go here:
    http://groups.google.com/group/jquery-dev/t/62a4f75f62a1737f

    Otherwise: great work once again! jquery’s my personal jesus.

  48. David Esperalta Says:

    Nueva versión de la librería jQuery

    No dejo de hablar de jQuery, pero, acabo de percatarme de que han publicado una nueva versión. En la

  49. Simon Coulton Says:

    Awesome work guys, donation incoming :)

  50. Pingdom explică viteza de încărcare a paginii | CNET.ro Says:

    […] PS: Fără nici o legătură cu cele de mai sus, aş vrea să atrag atenţia celor interesaţi că tot acum două zile jQuery - pe lângă că a împlinit doi ani - a mai avansat puţin, ajungând la versiunea 1.2.2. Taguri: Webaplicatii, Webmasteri Număr de afişări: 2 Apreciază articolul: (0 evaluări, media: 0 din 5)Trebuie să vă înregistraţi pentru a putea evalua articolul.  Loading … […]

  51. George Says:

    Seems to me new update has a problem with timer. following code http://interface.eyecon.ro/demos/sort.html stopped working with new JQuery. It works initially but after moving same panel couple of times it becomes unmovable.

  52. Joel Says:

    http://mootools.net/slickspeed/

    Hmm … they should get the new version, but jquery definitely is not showing up as the fastest here. Any particular reason?

  53. Jonatan Moleiro Says:

    Hi, i cant found a printable documentation of the 1.2.x version of jQuery. This is very usefull for a fast reference. Also y try to build one but i cant found a updated jquery-docs-xml.xml

    There’s a plan to update o release a print friendly version?

    Thanks for you work and this awesome library

    Jonatan

  54. [tuto mashup] Galerie photo animée via Flickr : animer votre galerie (2/2) « Antoine Guiral : apprenti du web 2.0 Says:

    […] Nous allons d’abord télécharger notre framework préféré >>JQuery<< et le plugin >>Interface<< qui nous intéresse. […]

  55. Alec Munro Says:

    Wow!

    Our main use of JQuery(a test results application) is now 2.5X faster when building result pages (which is basically all it does). Awesome.

    Thanks very much for your work on this, and I look forward to seeing it progress.

  56. ethodaddy Says:

    hey guys, great job and thanks for all the work you have done with jquery. I have found that some plugins stop working with this release an example being Sam Collett’s Select box manipulation. all seems fine but the addAjaxOption doesn’t work. I’m working on fixing the issue and will report a bug if need be.

    thanks again for the great job on this release….

  57. Galerii cu MooTools | CNET.ro Says:

    […] Începem cu o paranteză. În această lună jQuery a împlinit doi ani, apărând cu această ocazie versiunea 1.2.2, ce rezolvă unele bug-uri. Dar o veste mai bună este că o firmă din Los Angeles a angajat un om care să lucreze la jQuery. De fapt la subproiectul jQuery UI. Pentru mine este o veste extraordinară, pentru că în timp ce admit potenţialul extraordinar al acestui subproiect, sunt foarte dezamăgit de versiunea 1.0 cu care şi-a început existenţa, plină de bug-uri şi de incompatibilităţi între navigatoare. Cu un om dedicat (şi plătit), jQuery UI ar putea să devină un produs excelent, care să motiveze suplimentar folosirea excelentei librării jQuery. […]

  58. VCL for PHP development blog » jQuery 1.2.2 Says:

    […] http://jquery.com/blog/2008/01/15/jquery-122-2nd-birthday-present/ […]

  59. jgfoot Says:

    Psst.. you left the copyright year at “2007.” :)

  60. jQuery 1.2.2: 2nd Birthday Present | Development Feeds Says:

    […] Visit Original: jQuery 1.2.2: 2nd Birthday Present […]

  61. jQuery 1.2.2: 2nd Birthday Present | Development Feeds Says:

    […] Visit Original: jQuery 1.2.2: 2nd Birthday Present […]

  62. Hamid Says:

    Great job!
    thank you all for your excellent work.
    i will work on it…

  63. LỊCH SỬ HÌNH THÀNH VÀ PHÁT TRIỂN CỦA JQUERY : BLOG THIẾT KẾ WEB Says:

    […] January 15th, 2008 Bug fix for jQuery 1.2, library is now 2 years old: jQuery 1.2.2: 2nd Birthday Present [edit] 2007 […]

  64. Kazelmzl Says:

    Hi webmaster!

  65. Kazelwgv Says:

    Hi webmaster!

  66. Kazelhrh Says:

    Hi webmaster!

  67. [tuto mashup] Galerie photo animée via Flickr : animer votre galerie (2/2) | Antoine Guiral : apprenti du web 2.0 Says:

    […] Nous allons d’abord télécharger notre framework préféré >>JQuery<< et le plugin >>Interface<< qui nous intéresse. […]

  68. ewr Says:

    xzfsdf

  69. kustoz Says:

    Wow!

    That’s awesome!

  70. stephanazs Says:

    Interesting facts.I have bookmarked this site. stephanazs

  71. article spinner Says:

    great article here, if you want to learn how to spin an article check me out

  72. marlll Says:

    hey,what a good point,do keep it!

  73. rarmaibra Says:

    Funny foto here

Leave a Reply