jQuery 1.5.1 Released

Posted on by

jQuery 1.5.1 is now out! This is the first minor release on top of jQuery 1.5 and lands a number of fixes for bugs.

We would like to thank the following contributors that provided patches towards this release: antonkovalyov, csnover, danheberden, davidmurdoch, dmethvin, gnarf37, jaubourg, jeresig, jitter, jrburke, lrbabe, mathiasbynens, rwldrn, SlexAxton, and voxwerk.

We’d especially like to thank our bug triage team who assisted in narrowing down some of the important fixes needed for this release.

Downloading

As usual, we provide two copies of jQuery, one minified 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 Microsoft and Google’s CDNs:

Microsoft CDN: http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js

Google CDN: https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js

1.6 Roadmap Meeting

The core jQuery dev team is now taking proposals for changes to land in jQuery 1.6. Right now we’re shooting to release jQuery 1.6 late April/early May and will be meeting to discuss the submitted proposals at Noon EST on March 7th (the meeting will be in #jquery-meeting on irc.freenode.net).

Please submit your proposals through the following form in advance of the March 7th meeting.

jQuery 1.5.1 Changelog

jQuery 1.5.1 Test Swarm Results

API Documentation: jQuery 1.5.1 API Documentation

As this was a bug fix release there are no new features to report upon. The only changes are as follows:

jQuery now supports Internet Explorer 9 as a top level browser. All known bugs have been fixed and/or been reported to the IE team for resolution in the final release.

Three new options were added to jQuery.ajax():

  1. isLocal: Allow the current environment to be recognized as “local,” (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method.
  2. mimeType: A mime type to override the XHR mime type.
  3. xhrFields A map of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed.


Closed Tickets

A full list of all bugs and tickets closed are as follows:

  • #2551 Make sure .val() works after form.reset() in IE
  • #4537 Make sure .clone(true) correctly clones namespaced events
  • #4966 Don’t add “px” to unit-less properties when animating them
  • #6774 Make sure we only access parentNode if it’s available. Fixes an issue where after an option tag has been detached, an elem.parentNode error would be thrown.
  • #6911Prevent action on disabled elements, both triggering and bound via .live()
  • #7531 Fix again for IE9RC. Enhances ajaxSetup so that it can take an optional target option, in which case target will be updated instead of ajaxSettings. That way, fields that shouldn’t be deep extended can be listed and dealt with in one place. jQuery.ajax now makes use of ajaxSetup with target to create its internal settings object
  • #7568 Follow-up fix for #5862. Objects with a length property weren’t serialized properly by jQuery.param
  • #7653 Changes regexp to detect local protocol so that it will accept any protocol finishing by -extension
  • #7668 Sizzle and jQuery QUnit tests are out of sync
  • #7912 This change makes .cur() more .cssHooks friendly. .cur() now returns the unmodified value by .css() if it isn’t a number, number-alike or a value that needs a fallback to 0.
  • #7922 Fixed an issue where live(‘click’) doesn’t fire when live(‘submit’) is bound first in IE
  • #7945 Make jQuery.param() serialize plain objects with a property named jquery correctly
  • #8033 jQuery 1.4.4+ fails to load on pages with old Prototype (<= 1.5) or Current Prototype + Scriptaculous in IE
  • #8039 Selectors with HTML5 input types not work in IE6/7
  • #8052 Update jQuery.support.noCloneEvent test to function properly in IE9
  • #8095 Properly handles the case where browser cache needs to be bypassed while server-side logic still delivers proper 304 responses. Unit test added
  • #8098 Use the fast document.head when available
  • #8099 Always restore to correct display value based on element’s expected default display
  • #8107 Fix argument handling for $.ajax for multiple method signatues and add test case
  • #8108Temporary fix for jQuery metadata being exposed on plain JS objects when serializing with JSON.stringify to avoid compatibility-breaking changes. A proper fix for this will be landed in 1.6
  • #8115 Renames all references to jXHR with jqXHR in the code (like was done in the doc)
  • #8123 The default for .clone() is to not clone any events
  • #8125 Status is set to 200 for requests with status 0 when location.protocol if “file:”. Added test/localfile.html to control it works
  • #8129 Fix cloning multiple selected options in IE8
  • #8135 Makes sure any exception thrown by Firefox when trying to access an XMLHttpRequest property when a network error occured is caught and notified as an error. Added test/networkerror.html to test the behavior
  • #8138 Access to document.location is made only once at load time and if it fails (throwing an exception in IE when document.domain is already set), we use the href of an A element instead
  • #8145 Added readyWait tests
  • #8146 introducing the xhrFields option with is a map of fieldName/fieldValue to set on the native xhr. Can be used to set withCredentials to true for cross-domain requests if needed
  • #8152 applying the same special cases for protocol “chrome-extension:” as were for “file:” (needs tests). Re-organizes and fixes the handling of special cases for HTTP status code in the xhr transport
  • #8177 XHR transport now considers 304 Not Modified responses as 200 OK if no conditional request header was provided (as per the XMLHttpRequest specification)
  • #8193 Fixes abort in prefilter. No global event will be fired in that case even if the global option is set to true. Unit test added
  • #8198 Remove unnecessary “script.type = text/javascript;”
  • #8200 Unexpose $.support._scriptEval as it’s not needed. Use a private var instead
  • #8209 Make sure that mousing over Chrome “internal div” doesn’t trigger a mouseleave
  • #8219 Introduces the mimeType option to override content-type header in conversion (and in native xhr when possible). Adds companion overrideMimeType method on jqXHR object (it simply sets the option)
  • #8220 Remove backslashes from tag name filter
  • #8245 Ajax now ensures header names are capitalized so that non-compliant xhr implementations don’t override them
  • #8250 ajax does not work in opera 10 widgets
  • #8277 Sets data to undefined rather than null when it is not provided in ajax helpers so that it won’t revent data set in ajaxSettings from being used.
  • #8297 Make sure response headers with empty values are handled properly and do not prevent proper parsing of the entire response headers string.
  • #8353 Adds a catch block in resolveWith so that the finally block gets executed in IE7 and IE6.
  • #8365 Make sure that IE 9 still clones attributes.

jQuery 1.5.1 RC 1 Released

Posted on by

We’re nearing the first update to jQuery 1.5 – and we’re pleased to announce the release of the first release candidate! Barring any major bugs this should be the code that we end up shipping for jQuery 1.5.1 (which will be happening on February 24th).

jQuery 1.5.1 Release Candidate 1

You can get the code from the jQuery CDN:

You can help us by dropping that code into your existing application and letting us know that if anything no longer works. Please file a bug and be sure to mention that you’re testing against jQuery 1.5.1 RC 1.

We want to encourage everyone from the community to try and get involved in contributing back to jQuery core. We’ve set up a full page of information dedicated towards becoming more involved with the team. The team is here and ready to help you help us!

jQuery 1.5.1 RC 1 Change Log

The current change log of the 1.5.1 release.

  • #2551 Make sure .val() works after form.reset() in IE
  • #4537 Make sure .clone(true) correctly clones namespaced events
  • #4966 Don’t add “px” to unit-less properties when animating them
  • #6774 Make sure we only access parentNode if it’s available. Fixes an issue where after an option tag has been detached, an elem.parentNode error would be thrown.
  • #7531 Fix again for IE9RC. Enhances ajaxSetup so that it can take an optional target option, in which case target will be updated instead of ajaxSettings. That way, fields that shouldn’t be deep extended can be listed and dealt with in one place. jQuery.ajax now makes use of ajaxSetup with target to create its internal settings object
  • #7568 Follow-up fix for #5862. Objects with a length property weren’t serialized properly by jQuery.param
  • #7653 Changes regexp to detect local protocol so that it will accept any protocol finishing by -extension
  • #7668 Sizzle and jQuery QUnit tests are out of sync
  • #7912 This change makes .cur() more .cssHooks friendly. .cur() now returns the unmodified value by .css() if it isn’t a number, number-alike or a value that needs a fallback to 0.
  • #7922 Fixed an issue where live(‘click’) doesn’t fire when live(‘submit’) is bound first in IE
  • #7945 Make jQuery.param() serialize plain objects with a property named jquery correctly
  • #8033 jQuery 1.4.4+ fails to load on pages with old Prototype (<= 1.5) or Current Prototype + Scriptaculous in IE
  • #8039 Selectors with HTML5 input types not work in IE6/7
  • #8052 Update jQuery.support.noCloneEvent test to function properly in IE9
  • #8095 Properly handles the case where browser cache needs to be bypassed while server-side logic still delivers proper 304 responses. Unit test added
  • #8098 Use the fast document.head when available
  • #8099 Always restore to correct display value based on element’s expected default display
  • #8107 Fix argument handling for $.ajax for multiple method signatues and add test case
  • #8108Temporary fix for jQuery metadata being exposed on plain JS objects when serializing with JSON.stringify to avoid compatibility-breaking changes. A proper fix for this will be landed in 1.6
  • #8115 Renames all references to jXHR with jqXHR in the code (like was done in the doc)
  • #8123 The default for .clone() is to not clone any events
  • #8125 Status is set to 200 for requests with status 0 when location.protocol if “file:”. Added test/localfile.html to control it works
  • #8129 Fix cloning multiple selected options in IE8
  • #8135 Makes sure any exception thrown by Firefox when trying to access an XMLHttpRequest property when a network error occured is caught and notified as an error. Added test/networkerror.html to test the behavior
  • #8138 Access to document.location is made only once at load time and if it fails (throwing an exception in IE when document.domain is already set), we use the href of an A element instead
  • #8145 Added readyWait tests
  • #8146 introducing the xhrFields option with is a map of fieldName/fieldValue to set on the native xhr. Can be used to set withCredentials to true for cross-domain requests if needed
  • #8152 applying the same special cases for protocol “chrome-extension:” as were for “file:” (needs tests). Re-organizes and fixes the handling of special cases for HTTP status code in the xhr transport
  • #8177 XHR transport now considers 304 Not Modified responses as 200 OK if no conditional request header was provided (as per the XMLHttpRequest specification)
  • #8193 Fixes abort in prefilter. No global event will be fired in that case even if the global option is set to true. Unit test added
  • #8198 Remove unnecessary “script.type = text/javascript;”
  • #8200 Unexpose $.support._scriptEval as it’s not needed. Use a private var instead
  • #8209 Make sure that mousing over Chrome “internal div” doesn’t trigger a mouseleave
  • #8219 Introduces the mimeType option to override content-type header in conversion (and in native xhr when possible). Adds companion overrideMimeType method on jqXHR object (it simply sets the option)
  • #8220 Remove backslashes from tag name filter
  • #8245 Ajax now ensures header names are capitalized so that non-compliant xhr implementations don’t override them
  • #8250 ajax does not work in opera 10 widgets
  • #8277 Sets data to undefined rather than null when it is not provided in ajax helpers so that it won’t revent data set in ajaxSettings from being used.
  • #8297 Make sure response headers with empty values are handled properly and do not prevent proper parsing of the entire response headers string.

jQuery 1.5 Released

Posted on by

Right on schedule jQuery 1.5 is ready for consumption!

This release has been a long time coming and has been a real team effort. Please take this opportunity to thank members of the jQuery Team and the jQuery bug triage team for their help in getting this release out the door.

Downloading

As usual, we provide two copies of jQuery, one minified 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 Microsoft and Google’s CDNs:

Microsoft CDN: http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.min.js

Google CDN: https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js

About The Release

This release saw 83 fixed bugs and a total of 460 closed tickets.

The test suite (which now has 4437 tests) passes in all the browsers that jQuery supports – and more. We verified the suite passing all of the following browsers:

  • Safari 5.0.3 / 4.0.5 / 3.2.3 / 3.1.2
  • Opera 11.01 / 11 / 10.63 / 10.54 / 10.10 / 9.64
  • IE 6 / 7 / 8
  • Firefox 4.0b9 / 3.6.13 / 3.5.11 / 3.0.19 / 2.0.0.20
  • Chrome 8.0.552.215 / 8.0.552.237 / 9.0.597.67 Beta / 10.0.642.2 Dev

Additionally all of the API documentation for the release can be found on the API site: jQuery 1.5 API Documentation.

A full schedule of our upcoming releases can be found on our roadmap. Right now we’re planning on doing major jQuery releases more frequently (likely a couple times a year, rather than once per year).

So, without further ado, what’s changed in jQuery 1.5?

Ajax Rewrite

Easily the largest change in this release is the complete rewrite of the Ajax module in jQuery. This rewrite helps to fix a lot of gaps that existed in the old Ajax system along with providing a higher level of consistency across the API.

Perhaps the largest change is that a call to jQuery.ajax (or jQuery.get, jQuery.post, etc.) now returns a jqXHR object that provides consistency to the XMLHttpRequest object across platforms (and allows you to perform previously-impossible tasks like aborting JSONP requests).

More details concerning the new jqXHR object can be found in the jQuery.ajax() documentation.

In addition to a more consistent API the Ajax system is now much more extensible – allowing you to attach all sort of data handlers, filters, and transports. These changes should open up a whole realm of new Ajax plugins that can take advantage of this extensibility. More information can be found in the Extending Ajax documentation. The team is actively soliciting feedback on the Ajax extensibility API and if you have any feedback please feel free to direct it to the Developing jQuery Forum.

Deferred Objects

Along with the rewrite of the Ajax module a new feature was introduced which was also made publicly available: Deferred Objects. This API allows you to work with return values that may not be immediately present (such as the return result from an asynchronous Ajax request). Additionally it gives you the ability to attach multiple event handlers (something that wasn’t previously possible in the Ajax API).

For example, the following is now possible with jQuery’s internal Ajax API:

// Assign handlers immediately after making the request,
// and remember the jqxhr object for this request
var jqxhr = $.ajax({ url: "example.php" })
    .success(function() { alert("success"); })
    .error(function() { alert("error"); })
    .complete(function() { alert("complete"); });

// perform other work here ...

// Set another completion function for the request above
jqxhr.complete(function(){ alert("second complete"); });

Additionally you can make your own deferred objects using the exposed jQuery.Deferred. More information about this API can be found in the Deferred Object documentation.

Eric Hynds has written up a good tutorial on Using Deferreds in jQuery 1.5.

jQuery.sub()

jQuery now exposes a new way in which you can create and modify a clone of jQuery – all while still taking advantage of the full jQuery API. For example, you could use it to override native jQuery methods without actually affecting the methods that other users would interact with – or even create encapsulated APIs for your plugins that avoid namespace collision.

Here is a sample of adding a method to a jQuery sub so that it isn’t exposed externally:

  (function(){
    var sub$ = jQuery.sub();

    sub$.fn.myCustomMethod = function(){
      return 'just for me';
    };

    sub$(document).ready(function() {
      sub$('body').myCustomMethod() // 'just for me'
    });
  })();

  typeof jQuery('body').myCustomMethod // undefined

More information about jQuery.sub() can be found in the API documentation.

Note that if you’re looking to use this for plugin development, you should first strongly consider using something like the jQuery UI widget factory which manages both state and plugin sub-methods. Some examples of using the jQuery UI widget factory to build a plugin.

Adjacent Traversal Performance

In this release we’ve also been able to improve the performance of some commonly-used traversal methods: .children(), .prev(), and .next(). The speed-ups that we’re seeing are quite substantial (potentially many many times faster, depending upon the browser).

.children() Performance in jQuery 1.5

.prev() Performance in jQuery 1.5

.next() Performance in jQuery 1.5

Performance Test Case and Raw Numbers

Build System

Finally, we’ve made some changes to jQuery’s internal build system. We’ve worked to standardize all of our build process upon the excellent server-side JavaScript environment: NodeJS. We especially appreciate this as we’re able to reduce our dependency upon legacy Java/Rhino systems and focus more squarely on up-and-coming JavaScript environments.

Additionally with this switch we’ve moved to using UglifyJS from the Google Closure Compiler. We’ve seen some solid file size improvements while using it so we’re quite pleased with the switch.

Thanks!

As always we want to thank everyone that helped with this release – without your contributions this release would not have been possible. If you have any questions or spot any bugs please submit your issues to the jQuery bug tracker.

jQuery 1.5 RC 1 Released

Posted on by

We’re nearing the final release of jQuery 1.5 – and we’re pleased to announce the release of the first release candidate! Barring any major bugs this should be the code that we end up shipping for jQuery 1.5 (which will be happening on January 31st).

The final release notes and documentation will be coming with the final 1.5 release.

jQuery 1.5 Release Candidate 1

You can get the code from the jQuery CDN:

You can help us by dropping that code into your existing application and letting us know that if anything no longer works. Please file a bug and be sure to mention that you’re testing against jQuery 1.5 RC 1.

We want to encourage everyone from the community to try and get involved in contributing back to jQuery core. We’ve set up a full page of information dedicated towards becoming more involved with the team. The team is here and ready to help you help us!

jQuery 1.5 Beta 1 Released

Posted on by

Happy 5th Birthday to jQuery! jQuery was released on January 14th, 2006 today marks its 5th year of development!

To celebrate the occasion we’re releasing the first beta release of jQuery 1.5! We’re planning on having a final release candidate within 10 days and a final release by the end of the month.

We’d also like to announce three new additions to the jQuery core development team: Julian Aubourg, Colin Snover, and Anton Matzneller. All three of them have been major contributors towards the 1.5 release – providing significant code contributions, bug fixes, and triaging. Please take this opportunity to welcome them aboard!

Additionally we’d like to take take this opportunity to thank all the members of the jQuery community that have helped to get this beta release out – especially all the members of the bug triage team.

We want to encourage everyone from the community to try and get involved in contributing back to jQuery core. We’ve set up a full page of information dedicated towards becoming more involved with the team. The team is here and ready to help you help us!

So without further ado – jQuery 1.5 Beta 1!

jQuery 1.5 Beta 1

You can get the code from the jQuery CDN:

You can help us by dropping that code into your existing application and letting us know that if anything no longer works. Please file a bug and be sure to mention that you’re testing against jQuery 1.5 Beta 1.

jQuery 1.5 Beta 1 Change Log

This is a concise change log – full release notes will be coming with the final 1.5 release.

  • Rewrite of the Ajax module by Julian Aubourg. This is the most significant change in this release and brings a number of performance, stability, and feature improvements to $.ajax. More information can be found here #7195
  • Subclassing in jQuery now supported #7901
  • Removed the possibility of expando collisions when using noConflict() (V8 is fast!). The expando string now uses a random number + jQuery version to differentiate between instances of jQuery instead of millisecond clock time. #6842
  • Deduplicated code in $.get and $.post. #7847
  • When a native browser event is bubbling up the DOM, make sure that the correct isDefaultPrevented value is reflected by jQuery’s Event object. #7793
  • No longer cache non-html strings in buildFragment to avoid possible collision with the names of Object methods like toString. Testing shows this may also provide modest performance improvements. #6779
  • Updated cloneCopyEvent so that it does not create superfluous data objects when cloning elements. Exposes a new method, $.hasData, for determining whether or not an object has any data. #7165
  • Use a for loop rather than for/in loop when copying events so that code will work with an augmented Array.prototype. #7809, #7817
  • Fixed fadeIn not working properly with inline elements. #7397
  • Rewrote IE’s clone function to function properly in all known cases. #4386, #5566, #6997
  • Fixed IE breaking when dispatching a ‘submit’ event on plain JS objects. #6398
  • Fixed a regression in 1.4 that caused cache control to be set incorrectly for script transport. #7578
  • Improve performance of get() for negative indices. #5476
  • hasClass, removeClass didn’t work in IE if the attribute contained a carriage return (\r) character. #7673
  • Fix a regresion in 1.4.4 where calling $.fn.data without arguments breaks on non-DOM elements. #7524
  • Fixed memory leaks in IE caused by the custom abort function of $.ajax. #6242
  • Prevent live events from firing on disabled elements in IE. #6911
  • Fixed a regression in 1.4.3 that caused sending a Location object to $.ajax to no longer work. #7531
  • Fixed an issue where some traversal methods performed an unnecessary uniqueness check. #7964
  • We now support being able to specify callbacks to handle specific status codes#4964
  • Fixed an issue where ?? wasn’t supported as a context-insensitive placeholder for the callback name of a JSONP request. #4897
  • Data returned from dataFilter was not being passed to ajax complete() callbacks. We now use the jXHR’s promise interface to get the actual response. #4825
  • We now ensure that buildFragment clones elements properly in all browsers. #6655 and #3879
  • A memory leak caused when binding custom events in IE8 was fixed #7054
  • Lines in form data are now delimited by CRLF when the form is submitted (as recommended by the W3C). #6876
  • Ajax requests now abort on unload such that the event is only bound if the xhr transport is used. #5280
  • We now support =? being detected even if it has been escaped during data serialization. #5812
  • If the user uses the jsonpCallback setting we now automatically set the dataType to ‘jsonp’. #5803
  • The crossDomain option now forces ajax to consider a request as cross-domain, even when its not. This is useful when servers issue redirects to cross-domain urls. #5955
  • $.ajax(this) allowing retries without the recursion errors found in jQuery 1.4.3. #7461
  • Removed a patch for very early versions of Opera 9 that made it impossible to animate values smaller than -10000. #7193
  • ResponseText is now properly propagated for error callbacks. #7868
  • Scripts onload handler passes event as first parameter so statusText is now passed as second argument for aborts. #7865
  • With respect to xhr, setting contentType to false will now prevent the Content-Type header from being sent. #7465
  • When serializing text, we now encode all line breaks as CRLF pairs per the application/x-www-form-urlencoded specification. #6876
  • Fixed a bug with IE6 where certain event handlers were causing inter-page memory leaks. #7762
  • Tests for cross-domain detection now include checking for protocol, hostname and port. #7465
  • Fixed a problem where IDs containing a period would break find() without returning results. #7533
  • The regression with next/adjacent selectors no longer working without the ‘prev’ element has been corrected. #7452
  • Fixed the 1.4.3 regression which prevented the use of attr() on anything but DOM element nodes where the nodeType was 1 #7452, #7500,
  • A bug where including jQuery 1.3.2 resulted in a border on the right-hand side of the screen in IE8 has been fixed. #5575
  • We’ve fixed an issue where adding extra methods to Array.prototype and using jQuery.clone(true) to clone an element resulted in invalid event bindings. #6355
  • Fixed an issue where the nth-child does not handle whitespace correctly in Internet Explorer. #7558
  • We corrected a bug where mouseenter/leave behaved like mouseover/out when using live events #5821
  • Fixed a regression in 1.4.3 where the eq() selector was no longer working with previous and adjacent selectors #7906
  • Updated the documentation on event.currentTarget to address any confusion regarding jQuery.proxy. #7628
  • Fixed an issue where xhr.setRequestHeader(‘Accept’,…) appended the value rather than replacing it. #6230
  • An IE issue where ajax methods failed for content types ending in ‘+xml’ (eg. rss+xml) was fixed. #4958
  • The updates to ajax now allow any request to be aborted. #3442
  • A .slideUp() issue in FireFox 3.6.11 was fixed which previously hid the frameset border and legend but left any content uncovered by another element. #7308
  • We now support cross-browser XML parsing. #6693
  • Fixed a bug where when using dataType:’json’ in the .ajax() method, the data object was undefined in IE6 and 7. #6106
  • Corrected an issue where JSONP calls were not removing the script tag when the call completed. #7418
  • Updated the documentation to reflect the behaviour supported when using delay() with show() if the duration is not specified. #7543

jQuery 1.4.3 Released

Posted on by

jQuery 1.4.3 is now out! This is the third minor release on top of jQuery 1.4, fixing some bugs and landing some nice improvements.

I would like to thank the following community members that provided patches and input for this release: Anton M., Justin Meyer, Colin Snover, Ryan Tenney, Louis-Rémi Babé, David Petersen, Rick Waldron, Dave Reed, John-David Dalton, temp01, Heungsub Lee, J. Ryan Stinnett, Robert Katic, Juriy Zaytsev, James Burke, Jeffery To, Carl Fürstenberg, Jacob Wright, Jeff Robinson, Christian C. Salvadó, Andrée Hasson, Jason Webster, Dave Furfero, Adam Sontag, Travis Hardiman, DBJDBJ, and Ben Alman.

Along with the following jQuery team members: Scott González, Brandon Aaron, Yehuda Katz, Dave Methvin, Karl Swedberg, Paul Irish, Ralph Whitbeck, Jörn Zaefferer, Richard Worth, Doug Neiner, and Mike Alsup.

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 Google’s CDN:

General Improvements

We’ve made a number of improvements to the internals of jQuery and to the guidelines that we use for development.

JSLint

To start jQuery is now passing Douglas Crockford’s JSLint tool. We’ve integrated his tool into our workflow (checking out jQuery from Github and running ‘make lint’ will show the results) – giving us the ability to keep on top of possible regressions.

We’ve made a few minor changes to JSLint to suit our particular development style and have documented the results in the jQuery Core Style Guidelines.

Modularity

We’ve also removed a number of the inter-dependencies that exist in the jQuery source (inbetween modules). Doing this allows for a greater amount of flexibility when using a copy of jQuery from source. For example you could now use a script loader, such as LABjs or RequireJS to dynamically load individual jQuery modules (e.g. core, support, data, and events).

Additionally this change has made it so that you no longer need to build a copy of jQuery in order to run the jQuery test suite. This has dramatically improved our development workflow – allowing us to quickly make changes to jQuery and test the results without a (comparatively) slow build step.

New Features

All new features and changes can be found in the jQuery API documentation for 1.4.3.

CSS Module Rewrite

Nearly the entire CSS module has been rewritten focusing entirely on extensibility. You can now write custom CSS plugins that extend the functionality provided by .css() and .animate().

For example here is a plugin written by Louis-Rémi Babé that takes advantage of the new functionality: jQuery Rotate.

The plugin provides a cross-browser means of setting and animating the rotation of DOM elements just by using the traditional jQuery methods, like so:

$('#myDiv').css('rotate', 90);
$('#myDiv').animate({rotate: 180});

During the rewrite we broke down the functionality contained within jQuery into two very clear paths: Getting and setting an element’s .style property (done through jQuery.style) and getting the current computed style information of an element (done through .css() and jQuery.css – note that jQuery.curCSS is no longer used and is deprecated as a result). The functionality provided by .css() uses both the jQuery.style and jQuery.css methods.

Making this change has allowed for some speed-ups in computed style retreival, as well – yielding results that are up to 20% faster.

jQuery 1.4.3 .css() Getting a Value

The raw data for all the performance tests can be found in the following Google Doc Spreadsheet. All tests can be found in the jQuery source repository.

Data

The data module has seen a number of improvements greatly increasing its utility.

HTML 5 data- Atributes

To start the primary functionality provided by the jQuery Metadata plugin has been moved into core. HTML 5 data- attributes will be automatically pulled in to jQuery’s data object.

For example, given the following HTML:

<div data-role="page" data-hidden="true" data-options='{"name":"John"}'></div>

All of the following jQuery code will work.

$("div").data("role") === "page";
$("div").data("hidden") === true;
$("div").data("options").name === "John";

Note that strings are left intact while JavaScript values are converted to their associated value (this includes booleans, numbers, objects, arrays, and null).

The data- attributes are pulled in the first time the data property is accessed and then are no longer accessed or mutated (all data values are then stored internally in jQuery).

JavaScript Objects

A number of changes were made to when .data() is used on JavaScript objects (or, more accurately, anything that isn’t a DOM node). To start whenever you set data on a JavaScript object the data is set directly on the object – instead of going into the internal data object store. Additionally events that are attached to objects are put in a new ‘__events__’ property that is actually a function. This was done to allow events to be attached directly to an object, be garbage collected when the object is collected, and not be serialized by a JSON serializer. These changes should make jQuery’s data and event systems much more useful on JavaScript objects.

Events

jQuery has already had setData and getData events (which are broadcast whenever data is set or gotten through the .data() method) – overriding these methods makes it possible to override the default behavior for those features (namely you can return a different value or prevent a value from being set. Note that in jQuery 1.4.3 these events no longer bubble (allowing them to bubble proved to be too costly in most applications).

In 1.4.3 we’ve introduced a new event called changeData. This event is fired after any individual data properties are changed when using .data(). For example:

var user = new User();
$(user).bind("changeData", function( event, name, value ) {
  $("#user").find("#" + name).val( value );
});

The changeData event is used extensively by the new jQuery Data Linking plugin. It makes it possible for the data API to synchronize setting of JavaScript object properties with form fields.

Misc

There was one minor API change to .data() in 1.4.3: Calling .data(Object) no longer completely replaces the data object instead it extends the existing object, leaving the unspecified values in place. We found this to be the expected result based upon a number of confused bug reports.

Traversing

The performance of nearly all the major traversal methods has been drastically improved. .closest(), .filter() (and as a result, .is()), and .find() have all been greatly improved.

These improvements were largely the result of making greater use of the browsers querySelectorAll and matchesSelector methods (should they exist). The jQuery project petitioned the browsers to add the new matchesSelector method (writing up a test suite, talking with vendors, and filing bugs) and the whole community gets to reap the excellent performance benefits now.

jQuery 1.4.3 .closest() Performance

jQuery 1.4.3 .filter() on a Single Element

jQuery 1.4.3 .find() on an element

The raw data for all the performance tests can be found in the following Google Doc Spreadsheet. All tests can be found in the jQuery source repository.

The above performance results specifically look at three very common cases in jQuery code: Using .closest() on a single DOM node, using .filter() (or .is()) on a single DOM node, and using .find() rooted on a DOM element (e.g. $(“#test”).find(“something”)).

Note that the the browsers shown are those that actually support querySelectorAll or matchesSelector – existing browsers that don’t support those methods continue to have the same performance characteristics.

Ajax

A few new Ajax features have landed which should help plugin authors and those building progressively-enhanceable applications.

A new jQuery.readyWait property has been introduced which, when added to, delays the execution of the ready event. This should be used by plugins that wish to delay the ready event from occurring until a specified time. For example RequireJS has already implemented the use of this property allowing you to load dependencies that should be handled before the ready event fires. Whenever an item finishes loading you should end up calling jQuery.ready(true) (and if all dependencies are finished loading – and the DOM is ready – then the ready event will fire).

We’ve also added a new support property: jQuery.support.ajax. Simply this returns true in browsers that are capable of handling an ‘Ajax’ (XMLHttpRequest) request.

Events

.bind(“click”, false) and .unbind(“click”, false)

A convenient shortcut for binding a function that does nothing but return false (preventing the default action and stopping the event bubbling).

.click(data, fn)

All built-in event methods (such as .click()) now accept data as an initial argument (much like the bind method does).

event.namespace

A new property of the event object that contains the event namespace that was passed in to .trigger().

Effects

.show(speed, easing, callback), etc.

All animate methods now support easing. Much like how .animate() supports an easing argument (to be utilized by an easing plugin)

jQuery.fx.interval

A new property that exposes the rate at which all effects fire (in milliseconds – defaults to 13). Making this number smaller will make animations smoother in some browsers (such as Chrome) at the expense of CPU.

Misc

jQuery.type

Determine the internal JavaScript [[Class]] of an object. A number of different aspects are utilized to determine the exact return value for an object. The logic can be determined as follows:

  • If the object is undefined or null then “undefined” or “null” is returned accordingly.
  • If the object has an internal [[Class]] equivalent to one of the browser’s built-in objects we return the associated name. (More details about this technique.)
    • jQuery.type(true) === “boolean”
    • jQuery.type(3) === “number”
    • jQuery.type(“test”) === “string”
    • jQuery.type(function(){}) === “function”
    • jQuery.type([]) === “array”
    • jQuery.type(new Date()) === “date”
    • jQuery.type(/test/) === “regexp”
  • Everything else will return “object” as its type.

jQuery.isWindow

A simple method for determining if an object is likely to be a window.

jQuery.isWindow(window); // true

Additionally we now use he native Array.isArray method for jQuery’s isArray (if available) and we utilize the native String trim method provided by the browser (again, if available). A number of performance improvements were made to jQuery.trim, detailed in the following thread.

Testing

jQuery 1.4.3: Passing 3621 Tests in All Browsers

jQuery 1.4.3 is passing 3621 tests on all supported browsers. We’re 100% passing on Firefox 4 and nearly passing in IE 9 (we discovered two bugs, filed them, and one of them has already been fixed).

jQuery 1.4.3 Release Candidate 2 Released

Posted on by

jQuery 1.4.3 Release Candidate 2 is released! This is the second release candidate of jQuery 1.4.3. The code is stable (passing all tests in all browsers we support), feature-complete (we’re no longer accepting new features for the release), and needs to be tested in live applications.

Grab the code:

NOTE: If you’re using jQuery 1.4.3rc2 and you run into an error please make sure that you’re using the regular version of the code, it’ll make it easier to spot where the error is occurring.

How can I help?

To start, try dropping the above un-minified version of jQuery 1.4.3rc2 into a live application that you’re running. If you hit an exception or some weirdness occurs immediately login to the bug tracker and file a bug. Be sure to mention that you hit the bug in jQuery 1.4.3rc2!

We’ll be closely monitoring the bug reports that come in and will work hard to fix any inconsistencies between jQuery 1.4.2 and jQuery 1.4.3.

More details regarding the 1.4.3 release can be found in the previous post on jQuery 1.4.3rc1.

jQuery 1.4.3 Release Candidate 1 Released

Posted on by

jQuery 1.4.3 Release Candidate 1 is released! This is the first release candidate of jQuery 1.4.3. The code is stable (passing all tests in all browsers we support), feature-complete (we’re no longer accepting new features for the release), and needs to be tested in live applications.

Grab the code:

NOTE: If you’re using jQuery 1.4.3rc1 and you run into an error please make sure that you’re using the regular version of the code, it’ll make it easier to spot where the error is occurring.

How can I help?

To start, try dropping the above un-minified version of jQuery 1.4.3rc1 into a live application that you’re running. If you hit an exception or some weirdness occurs immediately login to the bug tracker and file a bug. Be sure to mention that you hit the bug in jQuery 1.4.3rc1!

We’ll be closely monitoring the bug reports that come in and will work hard to fix any inconsistencies between jQuery 1.4.2 and jQuery 1.4.3.

What to Watch For

There are a few areas in jQuery that have seen extensive changes since 1.4.2 was released:

  • .css() and related css-handling methods were all overhauled.
  • Logic for determining element visibility and toggling of display in animation code.
  • Much of the traversing logic has been improved and changed (is, filter, closest, find).

Full details concerning the release are forthcoming – for now we just need your help in catch regressions.

With your input we should be able to produce a solid release. Right now we’re looking to get the final 1.4.3 release out in time for the jQuery Conference in Boston this next weekend. Thanks for your help in reviewing jQuery 1.4.3rc1!

New Official jQuery Plugins Provide Templating, Data Linking and Globalization

Posted on by

As the jQuery project has grown, so have the needs of the developer community. As a project, we’re focused on building the best features possible and providing them in a reliable and open manner. Like most open-source projects, the software we’re able to offer is in no small part due to the generosity of many volunteers who donate their time and coding skills to make jQuery and jQuery UI some of the most widely used JavaScript libraries available.

In March, we announced at MIX 2010 that Microsoft had committed to supporting the jQuery Project via code contributions and resources. Shortly thereafter, Microsoft made available for public review their first jQuery plugin which provided client-side templating capabilities to the jQuery community. This was soon followed by their second plugin, jQuery Data Link, which offered data synchronization capabilities and, most recently, the jQuery Globalization plugin which offers globalization information to JavaScript applications for over 350 cultures ranging from Scottish Gaelic, Frisian, Hungarian, Japanese, to Canadian English.

During the seven months of development, the jQuery and Microsoft teams worked closely to ensure that the code conformed to the best practices specified by the jQuery project and filled specific needs of the jQuery community. We also ensured that any code contributed would be available to the jQuery community under the same non-restrictive licensing terms as the jQuery JavaScript Library.

Official jQuery Plugins

Today, we’re very happy to announce that the following Microsoft-contributed plugins – the jQuery Templates plugin, the jQuery Data Link plugin, and the jQuery Globalization plugin – have been accepted as officially supported plugins of the jQuery project. As supported plugins, the jQuery community can feel confident that the plugins will continue to be enhanced and compatible with future versions of the jQuery and jQuery UI libraries.

The jQuery Templates and jQuery Datalink plugin will be managed by the jQuery Core team while the jQuery Globalization plugin will become part of the jQuery UI project, allowing for extended globalization functionality for our rich UI library. In addition, the functionality found in the jQuery Templates plugin will be directly integrated into the jQuery Core library starting with version 1.5.

Documentation and Tutorials

To help you immediately use these plugins, we’re providing API documentation and tutorials that will help you ramp up on these new technologies.

API Documentation

Tutorials

Available for Download

Source code for the new plugins can be found on Github and we encourage the community to evaluate & enhance the functionality. The new plugins are available immediate download and the code can be found here:

jQuery Templateshttp://github.com/jquery/jquery-tmpl
jQuery Datalinkhttp://github.com/jquery/jquery-datalink
jQuery Globalizationhttp://github.com/jquery/jquery-global

New Contribution Vehicle

We’d like to thank Microsoft for their commitment to helping the jQuery Project and providing new and exciting functionality for the jQuery libraries. This has been a rewarding experience for both teams, laying the foundation for future collaboration and creating a new path for meeting the needs of the jQuery community.

Please be sure to read Microsoft’s joint announcement outlining the history of the effort and the importance of these contributions to Microsoft and the jQuery community:

jQuery Templates, Data Link, and Globalization Accepted as Official jQuery Plugins – Scott Guthrie, Corporate Vice President in the Microsoft Developer Division

jQuery Templates is now an Official jQuery Plugin – Boris Moore, Microsoft

jQuery Templating in the wild – James Senior, Microsoft

Web Camps TV #5 – Microsoft Commits Code to jQuery!
– Channel 9 Video

Microsoft to Expand its Collaboration with the jQuery Community

Posted on by

The jQuery Project is excited to announce that Microsoft is expanding its support of the jQuery JavaScript Library through new initiatives, to include code contributions, product integration, and the allocation of additional resources.

Building on two years of collaboration with the jQuery Project, Microsoft announced today at MIX 2010 that it will be working with the jQuery Core Team and community to provide source code that will help to further advance the jQuery JavaScript Library. The planned contributions target specific functionalities in areas of mutual interest. They include:

  • Templating
  • Script Loading
  • Data Binding

The initial focus will be on a new templating engine that will allow for easy and flexible data rendering via defined templates. Microsoft has submitted a proposal for public review along with an experimental plugin, and is actively collaborating with the jQuery team and community on a unified implementation. The templating engine will be reviewed and considered for inclusion into the jQuery JavaScript Library or maintained as an official jQuery plugin.

Microsoft will also ship a current release of the jQuery JavaScript Library in both Visual Studio 2010 and ASP.NET MVC as well as continue to host current versions of the library on the Microsoft CDN.

Lastly, Microsoft will be providing resources to assist in QA testing of jQuery in new environments to ensure continued stability and longevity of the library.

We see these contributions as a tremendous benefit to the jQuery effort and community and look forward to continued collaboration with Microsoft.