Blog

Blog » jQuery 1.4.2 Released

Posted February 19th, 2010 by John Resig

jQuery 1.4.2 is now out! This is the second minor release on top of jQuery 1.4, fixing some outstanding bugs from the 1.4 release and landing some nice improvements.

I would like to thank the following people that provided patches for this release: Ben Alman, Justin Meyer, Neeraj Singh, and Noah Sloan.

Downloading

As usual, we provide two copies of jQuery, one minified (we now use the Google Closure Compiler as the default minifier) and one uncompressed (for debugging or reading).

You can feel free to include the above URLs directly into your site and you will get the full performance benefits of a quickly-loading jQuery.

Additionally you can also load the URLs directly from either Google or Microsoft’s CDNs:

New Features

A full list of the API changes can be found in the 1.4.2 category on the jQuery API site.

In this release we’ve added two new methods: .delegate() and .undelegate(). These methods serve as complements to the existing .live() and .die() methods in jQuery. They simplify the process of watching for specific events from a certain root within the document.

For example:

$("table").delegate("td", "hover", function(){
	$(this).toggleClass("hover");
});

This is equivalent to the following code written using .live():

$("table").each(function(){
	$("td", this).live("hover", function(){
		$(this).toggleClass("hover");
	});
});

Additionally, .live() is roughly equivalent to the following .delegate() code.

$(document).delegate("td", "hover", function(){
	$(this).toggleClass("hover");
});

What’s Changed?

There has been some large code rewrites within this release, both for performance and for fixing long-standing issues.

Performance Improvements

As is the case with virtually every release of jQuery: We’ve worked hard to continue to improve the performance of the code base, making sure that you’re provided with the best performing JavaScript code possible.

According to the numbers presented by the Taskspeed benchmark we’ve improved the performance of jQuery about 2x compared to jQuery 1.4.1 and about 3x compared to jQuery 1.3.2.

jQuery Taskspeed Results (Feb 14, 2010)

Specifically we’ve improved the performance of 4 areas within jQuery:

While comprehensive benchmarks like Taskspeed can be interesting if deconstructed into individual sub-tests for further study, as a project we tend to stay away from using them as an accurate measure of true, overall, library performance. Considering how many aspects make up a library, not to mention the different techniques that they offer, cumulative results rarely reflect how an actual user may use a library.

For example, we saw significant overall performance speed-ups in Taskspeed simply by optimizing the $("body") selector because it’s called hundreds of times within the tests. Additionally we saw large gains by optimizing .bind() and .unbind() by a fraction of a millisecond – an inconsequential amount – especially considering that any cases where you would bind hundreds of events you would likely want to use .live() or .delegate() instead.

We’ve collected some results from the other major libraries as well but are less interested in those results and far more interested in the performance improvements that we’ve made relative to older versions of jQuery itself.

We will continue to work on optimizing the jQuery code base – indefinitely. It’s always a major concern for us to try and provide the fastest JavaScript/DOM-development experience possible. And yes, there will likely always be ways to gain additional performance – either through internal optimizations or by pushing critical functionality off into browser-land for standardization.

Event Rewrite

The largest internal changes have come through a much-needed structural rewrite of the events module. Many quirky issues related to event binding have been resolved with these fixes.

Namely event handlers are no longer stored as object properties in jQuery’s internal object store (with metadata attached to the handlers). Instead they’re now stored within an internal array of objects.

If you’ve ever had the opportunity to play around with .data("events") on a jQuery element you would find that it returns an object with all the event types currently bound, within it.

To enumerate some of the changes that have occurred during this rewrite:

  • It’s now possible to bind identical handlers with different data, namespaces, and event types universally.
  • Execution of event handlers will continue after one handler removes itself (or its sibling handlers).
  • We no longer attach data/namespace information directly to the event handlers (only a unique tracking ID).
  • We no longer use proxy functions, internally, to try and encapsulate handlers.
  • Execution order of events is now guaranteed in all browsers. Google Chrome had a long-standing error in their object-looping logic that has been routed around.

As a side-effect of these changes we had to change the newly-exposed special add/special remove APIs in order to accommodate the new event data objects. Ben Alman is in the process of writing up a large tutorial on jQuery’s special event system and we will be making additional announcements when that occurs.

Bug Fixes

There were a total of 40 tickets closed in this minor release. Some relating to differences between jQuery 1.3.2 and jQuery 1.4.x, some fixing long-standing issues (like in the case of the event module rewrite).

Raw Data

This is the raw data that we collected to generate the aforementioned charts.

	jQuery 1.3.2	jQuery 1.4.1	jQuery 1.4.2	Prototype 1.6.1	MooTools 1.2.4	Dojo 1.4.1	YUI 3.0.0
FF 3.5	2182	806	 565	 2156	 1073	 575	 1885
FF 3.6	1352	677	 519	 2067	 857	 750	 1494
Opera	983	697	 222	 793	 678	 218	 1201
Safari	610	435	 252	 315	 235	 238	 612
Chrome	1591	703	 293	 271	 312	 222	 745
IE 8	2470	1937	 1141	 3045	 4749	 1420	 2922
IE 7	4468	3470	 1705	 9863	 10034	 1737	 5830
IE 6	6517	4468	 2110	 13499	 11453	 2202	 7295

111 Responses to “jQuery 1.4.2 Released”

  1. Manmohanjit Says:

    Good stuff :)

  2. Ryan Says:

    Nice! Keep up the great work.

  3. jQuery 1.4.2 Released | Dev Loom Says:

    [...] jQuery 1.4.2 Released [...]

  4. Steve Souders Says:

    Great performance work!

  5. Launching jquery 1.4.2 « Ninofs menumpang Says:

    [...] mulai kecepatan eksekusi script, sampai dengan lain-lainnya, mungkin bisa dilihat lebih jelas di blog resmi dari jquery sendiri. Padahal baru saja beberapa waktu yang lalu memutakhirkan theme-theme di produk [...]

  6. Doug Says:

    awesomesauce!

  7. Vladimir Carrer Says:

    Wow, the performance improvements are overwhelming.

    One question. Can anyone write good tutorial about how core of jQuery works, something like “The core of JQuery for dummies”. I think that understanding of the core.js of JQuery can help many of us to write better jQuery code or better plugins.

  8. Dan Says:

    That raw data chart looks pretty crappy! would love to see the comparisons lined up in a table instead of a pre tag =]

  9. Dave Says:

    Caught up with Dojo…nice work!

  10. Beat Says:

    Wow !!!

    I’m amazed how many times you already doubled or more the performance!!

    jQuery, way to go ! :-)

  11. Ajaxian » jQuery 1.4.2: performance and a few APIs Says:

    [...] 1.4.2 has been released today and it comes with some performance bumps (aggressive ones according to Taskspeed). Benchmarks are [...]

  12. Krzysztof Tarnowski Says:

    I think that delegate()/undelegate() should completely replace live()/die():
    - live/die can be implemented using delegate/undelegate (potential feature bloat).
    - delegate and undelegate naming scheme is more consistent than live/die pair.

  13. Marak Squires Says:

    jquery.require

    please :-(

  14. Yansky Says:

    That graph is difficult to decipher.

  15. jQuery ????????? ?? ?????? 1.4.2- R@Me0!'s blog Says:

    [...] ??????????? (eng) jQuery 1.4.2 Released (eng) — ??????? ????????????? ????? [...]

  16. Martin Says:

    Nice work! Keep it up.

  17. Orson Says:

    Excellent!

  18. jQuery 1.4.2 is out « Wasim Farhat Blog Says:

    [...] http://blog.jquery.com/2010/02/19/jquery-142-released/ [...]

  19. jQuery 1.4.2 Released | Lick My Chip ! Says:

    [...] 1.4.2 Released Via Official jQuery Blog by John [...]

  20. jQuery: » Page not found Says:

    [...] jQuery 1.4.2 Released [...]

  21. Ken Roberts Says:

    Thank you John Resig, Ben Alman, Justin Meyer, Neeraj Singh, and Noah Sloan for 1.4.2.
    And John, thanks for creating this post explaining it. With examples, and charts, and thoughts on importance. All organized nicely to pour straight into my brain. I appreciate the quality.

  22. sroucheray Says:

    It seems that each minor release is still a major improvement. Good work !

  23. Devteca » jQuery 1.4.2 Says:

    [...] jQuery Blog. Categorías: Programación Etiquetas: JavaScript, [...]

  24. Javascript jQuery plugins visualizations don’t look half bad » Victus Spiritus Says:

    [...] JQuery 1.4.2 Released (jquery.com) Share and Enjoy: [...]

  25. jQuery 1.4 | uebbi.com Says:

    [...] está disponível a versão [...]

  26. Mike Howard Says:

    Here’s an HTML version of the raw data table:

     
    jQuery 1.3.2
    jQuery 1.4.1
    jQuery 1.4.2
    Prototype 1.6.1
    MooTools 1.2.4
    Dojo 1.4.1
    YUI 3.0.0

    FF 3.5
    2182
    806
    565
    2156
    1073
    575
    1885

    FF 3.6
    1352
    677
    519
    2067
    857
    750
    1494

    Opera
    983
    697
    222
    793
    678
    218
    1201

    Safari
    610
    435
    252
    315
    235
    238
    612

    Chrome
    1591
    703
    293
    271
    312
    222
    745

    IE 8
    2470
    1937
    1141
    3045
    4749
    1420
    2922

    IE 7
    4468
    3470
    1705
    9863
    10034
    1737
    5830

    IE 6
    6517
    4468
    2110
    13499
    11453
    2202
    7295

  27. Mike Howard Says:

    opps:

    try http://clove.com/jquery-raw-data-comparison.html

    and delete previous comment.

  28. jQuery accellère avec sa version 1.4.2 Says:

    [...] jQuery plait et ne cesse d’évoluer. La version 1.4 est sorti en janvier. Aujourd’hui, une nouvelle mise à jour vient améliorer la fameuse [...]

  29. jQuery 1.4.2 released (Perform… | BrettSinclair.net Says:

    [...] par Brett le 20-02-2010 jQuery 1.4.2 released (Performance improvements & new features) http://blog.jquery.com/2010/02/19/jquery-142-released/ No [...]

  30. MT22???? - Says:

    [...] JQUERY 1.4.2 RELEASED [...]

  31. Langeweile Says:

    Amazing… I´ll start working on something!

  32. jQuery 1.4.2 ??????? | ?? Says:

    [...] ???http://blog.jquery.com/2010/02/19/jquery-142-released/ 11 Digg ??: ?? ??: jQuery ?????????jQuery????????? (10) ?? (0) Trackbacks (0) ???? Trackback [...]

  33. fish4j Says:

    ??????

  34. Rakesh T Says:

    I recently came to know about it, but I did not find a good help file. Help should also be available in pdf or chm format.

  35. JQUERY 1.4.2 RELEASED | jQuery Tutorials in Thailand. Says:

    [...] jQuery 1.4.2 If you enjoyed this article please consider sharing [...]

  36. The Morning Brew - Chris Alcock » The Morning Brew #544 Says:

    [...] jQuery 1.4.2 Released – jQuery gets a further minor release on top of the 1.4 platform bringing a number of bugfixes and some impressive performance improvements giving a 3x improvement over jQuery 1.3.2 [...]

  37. Senamion Says:

    I hope that soon certify plugins, some are good, but some should be optimized…

  38. [Brève] JQuery 1.4.2 s’annonce avec des nouveautés - Websourcing.fr Says:

    [...] Plus de détails dans la note de version. [...]

  39. Slickspeed mit aktuellen JS-Versionen | web.dev.blog Says:

    [...] von Slickspeed frei verfügbar sind. Da jQuery in der 1.4er Reihe angeblich massiv die Performance verbessert hat und Dojo nun auch einige Versionen weiter ist, wollte ich wissen wie sich die aktuellen [...]

  40. Jannet Jackson Says:

    Firefox 3.6 $(window).unload not work ?

  41. jQuery 1.4.2 ??????? « Galcier's Blog Says:

    [...] ????? jQuery Minified (24kb Gzipped) jQuery Regular (155kb) ???http://blog.jquery.com/2010/02/19/jquery-142-released/ [...]

  42. jQuery 1.4.2 erschienen - Notes, Release, Funktion, Download, Interessante, jQuery-Blog, Infos, Elementen - homepagebewertung.de Says:

    [...] Notes, Download und weitere Interessante Infos findet Ihr im jQuery-Blog. « [Fundstück] 30 nützliche Web-Apps 2010-02-22 Tags: keine Kategorie: WebTec [...]

  43. Jeffrey Gilbert Says:

    Outstanding. Would be awesome to see a larger historical performance comparison dating back to the early releases of jquery (1, 1.2, 1.3, etc). I know there were similar graphics back then before JQuery had quite this much love.

  44. Sgt Surge Says:

    Any word on when the vsdoc for Visual Studio will be published?

  45. jQuery 1.4.2 comes with performance improvements! | stoimen.com/blog Says:

    [...] The new version of jQuery – 1.4.2 comes with some very good news. Check out the performance improvements here. [...]

  46. Waebo » jQuery 1.4.2 : Meilleures performances pour le framework JavaScript Says:

    [...] : Blog jQuery Framework, JavaScript, jQuery, MooTools, Prototype Développement web [...]

  47. Fresh From Twitter | mobile geo social Says:

    [...] 1.4.2 is blazing fast http://j.mp/9yUNZ9 has anyone cut a Mobile Safari subset that fits under 25Kb, so that it is cached on [...]

  48. Sharon Machlis Says:

    FYI the link to “Tutorials” here on this Web site is throwing a database error:

    A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:

    (SQL query hidden)

    from within function “MediaWikiBagOStuff::_doquery”. MySQL returned error “1205: Lock wait timeout exceeded; try restarting transaction (localhost)”.

  49. Nicholas Araujo Says:

    I love jQuery! Really easy to use!

  50. jQuery 1.4.2 « PHP Portal Says:

    [...] ??????????? ????? [...]

  51. Patrick Says:

    You guys rock… again!!!

    Patrick

  52. Webstandard-Blog Says:

    Very cool, but 155kb isn’t such small anymore, right? OK, there excist an gzipped version, but 155kb is quite big.

  53. Sergey Says:

    jQuery.getScript() does not work! old scripts run and run again when you call this function

  54. andy Says:

    greatt.. good job. we always need jquery.

  55. blog.deobald.org » Quergelesen 2010-02-28 Says:

    [...] Die Javascript-Bibliothek ist dabei nochmals deutlich schneller geworden. (siehe auch jQuery Blog, [...]

  56. jQuery 1.4.2 is Out, it’s again blazing fast ! | Whatever to succeed in rails' world Says:

    [...] jQuery 1.4.2 release note [...]

  57. James Says:

    Great stuff but need the vsdoc for Visual Studio. Any idea when that will be ready?

    Thanks,
    James.

  58. Brad Says:

    jquery floatobject-1.4 breaks my page when I upgrade to 1.4.2, it contains UI accordions (jquery-1.4.2 and jquery-ui-1.8rc3). The following call in floatobject-1.4 breaks;

    var offset = this.jqObj.offset();
    this.currentX = offset.left;
    this.currentY = offset.top;

    JavaScript says:
    offset is null

    if you hardcode 0′s for this.CurrentX and this.currentY, it eliminates any JavaScript errors. I’m not saying that’s a fix or work around, just a clue as to what’s gone wrong.

  59. jQuery 1.4.2 – Galeon's Howlingwolf Says:

    [...] I totally missed the jQuery 1.4.2 release. Guess I should release a new version of the Grails-jQuery-plugin soon [...]

  60. Saranya Says:

    There has been a great increase in performance.I found delegate() in this release.What is the actual difference between live() and delegate()? Is delegate() having high performance than live()?

  61. Ralph Whitbeck Says:

    @Saranya

    http://brandonaaron.net/blog/2010/03/4/event-delegation-with-jquery

    Take a look at this article by jQuery Core Team Member Brandon Aaron who describes each of the ways you can now do Event Delegation in jQuery which are $.bind(), $.live() and $.delegate().

  62. jQuery: » The Official jQuery Podcast – Episode 15 – John Resig (jQuery 1.4.1 – 1.4.2) Says:

    [...] jQuery 1.4.2 Released [...]

  63. giutip Says:

    Where is the visual studio documentation for 1.4.2?

  64. Joel Says:

    From The Philippines

    wow! makes developer’s life whole lot easier! thanks to jquery and the brilliant minds behind it.

  65. Gary Stafford Says:

    Great work, great performance increases. Looking forward to the Visual Studio vsdoc file – jquery-1.4.2-vsdoc.js. VS IntelliSense makes working jQuery that much easier.

  66. ??????? Says:

    Good framework and all the best to all developers ;)

  67. Help to IT » Blog Archive » Jquery New version 1.4.2 Says:

    [...] 1.4.2 (Release Notes) Minified, Uncompressed Documentation: Changelog [...]

  68. Mark Says:

    All I get is a blank page ????
    Im going back to 1.3

  69. jquery Says:

    we’ve tried to use 1.4.2 for our jquery products but cant manage to show transitions correctly in IE7 :(

  70. Martin Says:

    very good
    i love you jquery.

  71. blueeagle Says:

    Awesome! I see from the chart you’ve provided that Jquery runs faster on Safari browsers than on Chrome. That’s a helpful piece of information

  72. Kat Says:

    I cannot download this…is there something different for MAC?

  73. Mapping Says:

    JQuery, It makes my job more easy!Thank you!

  74. kim hyun jin Says:

    wow! good job! jquery love :)
    thank you! John Resig brother.

  75. jQuery 1.4.2 Released - Manmohanjit Singh Says:

    [...] the second minor release of jQuery 1.4 was released. According to the jQuery team, it fixes a outstanding amount of bugs from the 1.4 release and landing some nice [...]

  76. marcusklaas Says:

    Woa. Some awesome performance boosts for chrome. I’m loving it. Thanks.

  77. mylifestyle Says:

    why can’t submit the chinese comment?

  78. Customizable and Flexible jQuery Carousel Rotator – Spookyismy.name Says:

    [...] and works with jQuery 1.4.x+ (work with your older code? let me know in the [...]

  79. cqabl18 Says:

    how to download api

  80. allfakesmiles Says:

    I just started learning Jquery and your Tutorials are amazing
    thanks.

  81. Include the Latest Version of jQuery in WordPress without Duplicates - Maverick Web Creations Says:

    [...] Include the Latest Version of jQuery in WordPress without Duplicates Hello there! If you are new here, you might want to subscribe to the RSS feed for updates on this topic.At the time of this posting, WordPress 2.9.2 uses jQuery 1.3.2 but the latest version is 1.4.2. I wanted to use the latest version because it is supposedly about 3 times as fast as 1.3.2 as reported on the jQuery 1.4.2 release notes. [...]

  82. confused Says:

    can I just say, as a self-taught dreamweaver user who is looking for a good picture gallery for my website — yes jquery is the best, but I am absolutely at my wits end trying to work out how to put it into my website…… I am fairly competent at doing the things that are relevant to my needs, and my website is quite nice looking (i think) but I really want to improve my site by adding a good picture viewer and there seems to be NO help out there for someone like me, untrained in HTML code talk…
    I realise that I may be laughed out of this forum, and that I am probably in way over my head, but I literally don’t know where to look or what to look for. You have all this code, but there are NO SIMPLE STEP-BY-STEP INSTRUCTIONS – how do I organise the files? where do I put the code? why can’t I make it work? Why do you have to have a PhD to understand what to do? Or is there some secret code of honour amongst you web people that means you don’t want self taught ‘outsiders’ to gain any knowledge and do things for themselves..?
    can anyone please please help me?

  83. confused Says:

    p.s In case anyone takes pity on me (after my rant) and decides to offer me some advice — I am a mac user, and my website (badly in need of updating) is hand-drawnmaps.co.uk

  84. Patrick Says:

    Sorry about my English, I’m from Belgium.
    At this moment I can’t say if it is great or not, i’m learning it.
    I see many laguages of this tutorial, but no dutch one. Can anyone write this in Dutch? So I can understand the English details.
    Thank you
    Patrick

  85. Installing JQUERY | JNBCLICK.ORG Says:

    [...] Download JQUERY  from  http://blog.jquery.com/2010/02/19/jquery-142-released/ in this place there is 2 [...]

  86. jQuery 1.4.2 | MicroLibros Says:

    [...] jQuery Blog. Escrito por MicroLibros   @   20 February 2010 0 Comentarios [...]

  87. Prashanth Says:

    Fantastic Framework to work which will make the workload less. Nice to see new version with improved performace.

    Thank you
    Prashanth G

  88. thd Says:

    good,so for me

  89. kucuksirlar Says:

    thansk you me.

  90. The Official jQuery Podcast Says:

    [...] Blog post [...]

  91. harika Says:

    interesting:) thank you

  92. cc Says:

    ???

  93. auchan Says:

    thankyou!the jquery is very good!i’m study is now!

  94. Sakher Says:

    wonderful, but waiting .vsdoc !!!

  95. krish Says:

    thanks lot for updated version.

  96. tony b Says:

    I’m trying to downloads jquerry, to my phone. Its a Samsung with
    Jquerry 1.1.having trouble any help?

  97. And Says:

    very good articles for ????? wmz ? ??????

  98. tc Says:

    How come there are still no vsdocs?
    I mean no rush, it’s been _only_ 7 months.
    What a great partnership between MS and you guys.
    This tells us so much about how MS cares about JavaScript support in Visual Studio :(
    Can anyone recommend an IDE with real support for JavaScript?
    Aptana, WebStorm, anything else?

  99. gespadas.com » jQuery 1.4.2 Says:

    [...] jQuery Blog. MeneameBitacorasFacebookTwitter Categorías: Desarrollo Etiquetas: jquery blog [...]

  100. ??? Says:

    good

  101. Manoj Says:

    I am Preparing for Google Adword Professional exam.
    Is there any practice exam available????.
    Please give me details about it

  102. Roberto Says:

    Hi People
    I got a menu that use jquery 1.3.2 and get problems width this post gadget because of jquery 1.4.2. ¿What can I do? regards

  103. Daskar Says:

    If you want to know more about the SECRETS of SEO join with me

  104. Manoj Says:

    Question:
    Is there a way to see how the pages that have been indexed are ranked without having to type it in at Google and then start searching ?

  105. seo in chennai Says:

    What do you think of pop-under exchanges? I’m having trouble getting visitors to my site,
    so I’m thinking about trying one. Are they effective?

  106. Haneefa Abdulla Says:

    Hi,

    I E Browser reports an error warning on line 4618 when I load jquery from the following library.

    http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js
    I need this js for the right functioning of jScrollPane. Please fix this error

    Haneefa
    Bridge-India

  107. Reasons to be excited about Drupal 7 « Los Angeles Investment Realestate Says:

    [...] supports jQuery 1.4.2 (Drupal 6 was stuck at 1.2.x). This creates an easier process to install and update modules (like [...]

  108. Reasons to be excited about Drupal 7 :: Real Estate Tips Says:

    [...] supports jQuery 1.4.2 (Drupal 6 was stuck at 1.2.x). This creates an easier process to install and update modules (like [...]

  109. Reasons to be excited about Drupal 7 » Genuine is the digital agency for the age of engagement Says:

    [...] supports jQuery 1.4.2 (Drupal 6 was stuck at 1.2.x). This creates an easier process to install and update modules (like [...]

  110. Interactive Form Functionality on the Client-Side Using jQuery « Programmatic Ponderings Says:

    [...] for the development version of the example. The production copy uses a later, minified version of jQuery 1.4.2, which is notably faster than [...]

  111. Using knockout to perform CRUD operations (Ajax) in ASP.NET | Colour Blend Creative Says:

    [...] jQuery (A javascript framework that will help use Ajax with simple syntax) [...]

Leave a Reply