jQuery 1.5 is out

The jQuery team has released a new version of their awesome framework – jQuery 1.5. While not seemingly as significant as the 1.4 release, they made quite a few major changes under the hood.

On top the various bug fixes and performance enhancements one of the major changes in jQuery 1.5 is a complete rewrite of the Ajax module.

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

jQuery also now added a new way to extend it, using jQuery.sub(). jQuery.sub() allows you to create a clone of jQuery and modify its methods while keeping the originals intact.

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.

Last but not least Deferred Objects are now a part of jQuery. With deferred objects you can use multiple event handlers on Ajax requests. So you can do something like this for example

var someajax = $.get('page.html').success( function(response){
	// do something here

// some other code here which may or may not execute before the ajax request is done

someajax.success( function(response){
	// some more stuff to do on success

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).

You can read more about the jQuery 1.5 release on their website.

Be the first to comment on this post

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>