jQuery 1.3.2 released

Posted on by

Downloading

jQuery 1.3.2:
http://code.jquery.com/jquery-1.3.2.min.js minified (19kb with Gzipping)
http://code.jquery.com/jquery-1.3.2.js regular (120kb)

Changes

Elements Returned in Document Order

This is a change to jQuery’s selector engine that re-orders the returned results to be in document order, instead of the order in which the selectors were passed in. This change was done in order to be in compliance with the Selectors API specification (which jQuery uses, internally, in browsers that support it).

A sample result:

  // jQuery 1.3.1 (and older)
  $("h1, h2, h3")
  => [ h1, h1, h2, h2, h3, h3 ]

  // jQuery 1.3.2
  $("h1, h2, h3")
  => [ h1, h2, h3, h3, h1, h2 ]

I’d like to thank Diego Perini for pushing us to get this implemented.

.live() Can Now Prevent Bubbling

It’s now possible to call event.stopPropagation() or return false within a callback and have it stop the bubbling of the live event. This means that you can now bind live events inside each other and have the inner handlers prevent the outer handlers from firing.

For example:

  <ul>
    <li><b>Google</b></li>
    <li><b>Yahoo</b></li>
  </ul>
  <script>
    $("li").live("click", function(){
      $(this).addClass("active");
    });
    $("li b").live("click", function(){
      $(this).addClass("active");
      return false;
    });
  </script>

I’d like to thank Iraê for the solution that he proposed for this problem.

For those wondering about the, currently missing, features of .live() (like submit and change events) you can expect all of those to land in jQuery 1.3.3, due to arrive sometime next month.

:visible/:hidden Overhauled

We’ve changed the logic behind the :visible and :hidden selectors (which were used throughout jQuery to determine the visibility of an element).

This is how the logic has changed:
* In jQuery 1.3.1 (and older) an element was visible if its CSS “display” was not “none”, its CSS “visibility” was not “hidden”, and its type (if it was an input) was not “hidden”.
* In jQuery 1.3.2 an element is visible if its browser-reported offsetWidth or offsetHeight is greater than 0.

What does this change mean? It means that if your element’s CSS display is “none”, or any of its parent/ancestor element’s display is “none”, or if the element’s width is 0 and the element’s height is 0 then an element will be reported as hidden.

What is the benefit of making this switch? The result is two-fold:
* The performance is much, much, better. (See below.)
* An element is reported as “hidden” if it’s inside a “hidden” element (something that wasn’t possible before, without the use of a plugin.

I’d like to thank Matheus Almeida for proposing some of the changes that were implemented to improve the performance of these selectors.

.height()/.width() Overhauled

The width and height related selectors have all been overhauled – dramatically improving their speed in all browsers.

I’d like to thank Mike Helgeson for his contributions here which were largely responsible for some of the massive gains that we’re seeing in these methods.

Selector Speed-up in IE

The benefits of the new Sizzle selector engine are really starting to come to light as contributions from the larger JavaScript community come in. A number of additions have landed that have helped to improve the performance of the engine – especially in Internet Explorer.

I’d like to thank Fabio Buffoni for his contributions here which were largely responsible for these speed-ups.

.appendTo()/etc. Now Return Inserted Elements

This is a (minor) API change – resolving a bug in the jQuery API. The methods appendTo, prependTo, insertBefore, insertAfter, and replaceAll all now return the set of inserted elements, instead of the original set of elements.

To understand this change we need to look at a simple example.

Given the following markup, in jQuery 1.3.1 (and older) the following would occur:

  <div></div>
  <div></div>
  <script>
  $("<p/>")
    .appendTo("div")
    .addClass("test");
  </script>

The result in 1.3.1 (and older):

  <div><p class="test"></p></div>
  <div><p></p></div>

This was due to the fact that .appendTo, etc. would only return the elements that were passed in to it, instead of the elements that were actually inserted (and since only a single paragraph was passed in – the first one to be inserted – only the first paragraph had the class added to it).

Thus, if you were to run the same code in jQuery 1.3.2 you would end up with:

<div><p class=”test”></p></div>
<div><p class=”test”></p></div>

Which is the expected result. The only catch is that appendTo, prependTo, insertBefore, insertAfter, and replaceAll all now push onto the jQuery stack (meaning that they’re affected by .end().

We did a survey of existing uses of the above methods and could find no cases where this change would affect any existing code, so we felt safe going ahead with it (especially considering that it’s the expected behavior, to begin with).

Testing

We have a couple announcements with regard to our test suite and our testing methodology in the jQuery project.
* We are now fully supporting, and the test suite is completely passing in, Internet Explorer 8rc1 and Chrome 2 (Nightly) (in addition to our normal selection of browsers).
* The test suite has broken 1500 tests (1504, to be precise).

This means that we now actively test in – and pass the test suite in – 11 browsers: Chrome 1, Chrome Nightly, IE 6, IE 7, IE 8rc1, Opera 9.6, Safari 3.2, WebKit Nightly, Firefox 2, Firefox 3, Firefox Nightly.

(We’re waiting for the next beta of Opera 10 before we begin to support it fully, there are some critical problems with the current beta.)

To measure the performance of different portions of jQuery we used a modified copy of the SlickSpeed test suite to run our tests (adapted to handle non-selector tests). The raw results for the test runs can be found below (all times in milliseconds).

Selector Tests

We used a copy of the Yahoo home page (a representatively complex web page) and used a selection of selectors that people actually use. Targeting selectors that people currently use will help to improve the performance of both existing and future applications.

Frameworks	jQuery 1.2.6	jQuery 1.3	jQuery 1.3.2
IE 6		1059		799		626

:hidden/:visible Tests

We tested both the :hidden and :visible selectors on a number of elements in our test page.

Frameworks	jQuery 1.3	jQuery 1.3.2
Firefox 3	1512		190
Firefox 3.1	1202		161
Safari 3.2	592		80
Safari Nightly	334		43
Opera 9.6	1307		497
IE 6		1948		738
IE 7		1295		830
Chrome		490		30

width/height Tests

We tested both the width, height, innerWidth, innerHeight, outerWidth, and outerHeight methods on our test page.

Frameworks	jQuery 1.3	jQuery 1.3.2
Firefox 3	310		106
Firefox 3.1	281		84
Safari 3.2	146		37
Safari Nightly	166		32
Opera 9.6	345		116
IE 6		313		124
IE 7		283		123
Chrome		113		27

Think You’re Good at CSS & Want a Free Pass SXSW? Check This Contest Out.

Posted on by

jQuery UI sponsor Filament Group is holding an awesome contest:

“To celebrate ThemeRoller’s selection as a finalist for the SXSW Web Award for Technical Achievement, we’re holding a contest to give away one free pass to the SXSW Interactive Festival to the person who creates the coolest use of the new jQuery UI CSS framework.”

Check out the contest post here: Contest: Win a Free Pass to SXSW Interactive for the Coolest Use of the jQuery UI CSS Framework

Quoting Filament:

SXSW badge

We’re really excited about the new jQuery UI CSS framework because it makes it easy to theme UI widgets or even entire layouts with the jQuery UI ThemeRoller web application. To celebrate the nomination and encourage everyone to take advantage of this new framework, we’re holding a contest to see who can demonstrate the most creative use of the framework’s capabilities. The winner will receive a free pass to the SXSW Interactive Festival in Austin, Texas, March 13-17, 2009.

How to get started

First off, download a theme and demo page from jQuery UI ThemeRoller and review the jQuery UI CSS framework documentation to get an idea of how the framework is used. Then head over to the jQuery UI site and grab the handy Firefox ThemeRoller bookmarklet to help you test your styles as you build your project. If you’re creating a demo page, we strongly suggest that you include the Theme switcher dropdown to let people quickly sample ThemeRoller themes on your page and really show off the theming in action.

Remember, the CSS framework is not just for jQuery plugins — framework styles can be used with any Javascript library or your own custom markup. We’d be thrilled to see how far you can go with a cool WordPress template, corporate website, widget or even a game to show the power and flexibility of this system. Feel free to use multiple scoped, themes, too — go wild.

How to enter

We’re going to keep this simple: post a comment with a brief description of your project and a link to a functioning example. The winner will be decided by Filament Group based on the creativity, quality and inventiveness of their project.

Contest rules

  • Everyone is eligible, no exceptions.
  • You may submit any type of project that uses the jQuery UI CSS framework: public sites, demo pages or anything else that shows off your creativity and is publicly accessible (read: not behind a login).
  • You may enter as many unique projects as you wish; each will count as a separate entry. (Please don’t post the same one over and over…that may count against you).
  • The entry deadline is Wednesday, February 25, 2009 at midnight.
  • The contest winner will be announced on Friday, February 27, 2009.
  • The winner will receive a single pass to the SXSW Interactive Festival, which includes admission to the SXSW Web Awards ceremony on Sunday, March 15. We will email you an access code that will allow your to register for free. (NOTE: the pass does not provide entry to the Film or Music festivals, nor does it include transportation, room/board, or meals — you’ll need to cover those yourself.)
  • jQuery UI and Filament Group Inc. reserve the right to link to your project (we want to promote your hard work).

A little inspiration

To show off what is possible with the jQuery UI CSS framework, here is a really fantastic example of a plugin that uses the framework really well, from styles to icons. Nicolas Rudas created a very cool Apple-style file browser that also includes the theme switcher dropdown for good measure. He’s taken this a step further by creating a jQuery API browser that uses his plugin. Very cool indeed.

(NOTE: Nicolas Rudas was not notified prior to the announcement of this contest, so Nicolas, if you’d like to enter you’re still eligible to win. How’s that for competition?)

image

There is a list of plugins that use the CSS framework on the documentation wiki but it’s pretty short at the moment and we’re hoping that this contest really gets people fired up to try out the framework for themselves.

So…get to it, show us what you’ve got!

Check out the contest here: Contest: Win a Free Pass to SXSW Interactive for the Coolest Use of the jQuery UI CSS Framework

jQuery UI 1.7 is the new 1.6

Posted on by

The jQuery UI team has been working for over 9 months on the 1.6 release and during this long process, we’ve deeply re-factored every plugin and introduced a very big shift in how we write markup and styles with the new jQuery UI CSS Framework. Also during that time, the jQuery core library released the new 1.3 version which incorporates a lot of improvements that we wanted to leverage.

We hear ya

We clearly have heard the confusion as these fairly large changes were made between release candidates in the 1.6 development cycle (post 1.6rc2). Based on feedback from the jQuery UI community, we want to address the confusion around compatibility between jQuery 1.2.6 and 1.3 and the jQuery UI library by creating two very distinct releases in the next few weeks:

1.6rc6 plus fixes will become 1.7 (compatible with jQuery 1.3+)

What we are currently calling jQuery UI 1.6rc6 is going to be released as jQuery UI 1.7. This code is built from the ground up to take full advantage of jQuery 1.3 and the new jQuery UI CSS Framework and is different enough to warrant a dot release. After a lot of analysis, we’ve decided that compatibility with both 1.2.6 and 1.3 is not feasible in a single UI release while still having a maintainable and lean codebase, so this version will not be compatible with jQuery 1.2.6 or earlier.

1.6rc2 plus fixes will become 1.6 (compatible with jQuery 1.2.6)

For all those folks still actively using jQuery 1.2.6, we want to provide a legacy release of the jQuery UI library based on 1.6rc2 that ports over as many bug fixes and improvements as possible from more recent code updates to provide a clear, stable foundation that will be fully compatible with jQuery 1.2.6. To avoid any confusion, this version will be called jQuery UI 1.6 final. Since this will be a legacy release, the team will not be actively developing this code once it is finalized. Also, this release will not contain any changes related to the new jQuery UI CSS Framework. It will have the same theming support as jQuery UI 1.5.3.

We understand that this is a fairly large change and welcome input from the community on how to make the upgrade as smooth as we possibly can. A complete upgrade guide will be posted shortly to guide you on a plugin-by-plugin basis to help ease the transition.

Current Release Status

We received a lot of great help testing the latest release candidate, 1.6rc6, and are fixing the final few issues, so that it can be released as soon as it’s ready. A current summary status of the release can always be found on the front page of our Dev and Planning wiki ( http://wiki.jqueryui.com/ ). We are very excited about the quality of this new jQuery UI release because it will serve as a solid foundation that will give us a stable API and let us release more frequently throughout the year with updates and new widgets.

Weekly releases coming

Starting in March we will switch to a weekly release mode. Each week we will alternate between pushing a stable bug fix release (1.7.1, 1.7.2, etc.) and a preview release (alpha, beta, rc) including new plugins and functionality. So each branch will receive an update at most every two weeks. If we need an additional release in-between or we need to add an extra beta or rc, we will do so on a week-to-week basis, adjusting the rest of the roadmap accordingly. Our goal is to work toward a 6-8 week release cycle (2-3 weeks alpha, 2-3 weeks beta, 1-2 weeks rc, then final).

Download builder update

We have pushed a complete update to the Download Builder. It is now fully integrated with ThemeRoller so that you can download a customized jQuery UI library zip including a pre-built or custom theme. We’ve also fixed up some issues that existed with downloading an invalid zip file in IE and also 1.5.3 minified files.

Thank you for your help and support

We want to thank the community for it’s support and encourage your participation in helping us to develop the best UI library on the planet. If you are a developer who is interested in helping us with bug fixing, please feel free to post a message on the ui-development group ( http://groups.google.com/group/jquery-ui-dev ) and ask how you can help out.

jQuery UI 1.6rc6: Help us test!

Posted on by

jQuery UI 1.6rc6 is available.

Download jQuery UI 1.6rc6
You can download the entire development bundle directly at

http://jquery-ui.googlecode.com/files/jquery.ui-1.6rc6.zip

This includes a default theme, as well as all the test and demo files. Or you can create a customized download of individual components

http://jqueryui.com/download/

and a custom theme at

http://jqueryui.com/themeroller

This is the final step before releasing 1.6 final tomorrow (Saturday night). Since we only have two days, we really need you help us test if there are no major blockers left we might have overseen. Please create a ticket for any issue you find on the jQuery UI bug tracker:

http://dev.jqueryui.com/ (note: requires registration)

and send a note for discussion on the jQuery UI Development mailing list as well:

http://groups.google.com/group/jquery-ui-dev

Thanks everyone, prepare for a great weekend!

jQuery Meetup in San Francisco

Posted on by

There are a few jQuery guys in San Francisco this week and we thought it’d be fun to have a meetup. John Resig (Creator of jQuery), Rey Bango (Head of jQuery Evangelism Team) and Yehuda Katz (Rails Core Contributor, jQuery Team Member) will all be meeting up tomorrow night (the 29th) if you want to say ‘hi’.

More information can be found on the Upcoming.org site for the event – feel free to add yourself if you’re interested in coming:
jQuery(“#drinks”).imbibe();

jQuery 1.3.1 Released

Posted on by

Welcome Digg users! You may be interested in the full jQuery 1.3 release, which just happened on the 14th. Enjoy!


This is a bug fix release for jQuery 1.3. You can view the full list of what was fixed on the bug tracker.

There are no significant changes in 1.3.1 from 1.3 other than straight bug fixes. If you are still using jQuery 1.2.6, and looking to upgrade, please upgrade directly to this release.

Downloading

A copy of jQuery 1.3.1 is also available on Google’s CDN (feel free to copy the URL directly into your site):

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

A couple quick housekeeping notes:

Some noted in the release notes for 1.3 that we missed testing on Firefox 2, even though we still support it. This was a mistake on our part: We still support Firefox 2 and test on it prior to releases. You can see the full test suite run below.

jQuery 1.3.1

It was also noted that Safari 2 didn’t show up in the list of browsers that we tested against prior to the 1.3 release. This is correct – we are phasing out support for Safari 2 in jQuery. Considering that Safari 2 shows no appreciable market share and has been superseded by 3 separate Safari releases (3.0, 3.1, and 3.2) we no longer see a need for significant testing against that release.

Finally, a few users noticed that we no longer provide a “packed” version of jQuery (a version of jQuery run through Dean Edwards’ Packer with Base62 encoding turned on). We did this for a couple reasons:

  • Packed scripts are significantly harder to debug (even harder than minifed scripts).
  • Packed scripts aren’t able to run on all platforms without issue (such as Adobe AIR and Caja-capable environments).
  • But most importantly: Packed scripts are slower for the user than what you would get from using just minification. This may seem counter-intuitive since a packed script’s file size is smaller than a minified script but the final load time ends up being much higher (due to the decompression step it must go through). We have some data regarding the loading performance of minified scripts vs. packed scripts, for those that are interested.

The minifed copy of jQuery that we provide, run through the YUI Compressor, should be the optimal form of jQuery to use in a production environment (served using gzipping, if possible).

jQuery UI 1.6rc5 Compatible with jQuery 1.3

Posted on by

jQuery UI 1.6rc5 is available.

Download jQuery UI 1.6rc5
You can download the entire development bundle directly

http://jquery-ui.googlecode.com/files/jquery.ui-1.6rc5.zip

This includes a default theme, as well as all the test and demo files. Or you can create a customized download of individual components

http://ui.jquery.com/download/

and a custom theme at

http://ui.jquery.com/themeroller

Be sure to grab an updated 1.6rc5 theme, if you got a theme from ThemeRoller in the last two weeks. (Also, for any users of 1.5.3, there is a link on ThemeRoller for downloading legacy themes)

Compatibility with jQuery 1.3
Thank you to the many people that helped test and contribute fixes to make this release happen. We have fixed a lot of issues in the two weeks since rc4 and the most major fix is this release is compatible with jQuery 1.3 (Happy Birthday jQuery) where 1.6rc4 was only compatible with jQuery 1.2.6. From now on, we ask that 1.6rc4 is no longer used for testing. Also, from here forward jQuery UI 1.5.3 will only support jQuery 1.2.6. And jQuery UI 1.6 will only support jQuery 1.3+
Thanks for any help you can provide to ensure this release is ready and fully compatible with jQuery 1.3. Please create a ticket for any issue you find on the jQuery UI bug tracker:

http://ui.jquery.com/bugs (note: requires registration)

and send a note for discussion on the jQuery UI Development mailing list as well:

http://groups.google.com/group/jquery-ui-dev

The current schedule is to wrap up 1.6 final by the end of next week.

jQuery 1.3 Released

Posted on by

The jQuery team is pleased to release the latest major release of the jQuery JavaScript library! A lot of coding, testing, and documenting has gone in to this release and we’re really quite proud of it.

I want to personally thank Ariel Flesler and Brandon Aaron who put a lot of work into fixing bugs and getting the release out the door.

Overview

There have been a number of major changes in jQuery 1.3, these are a few of the largest and most prominent changes.

Sizzle Selector Engine

jQuery has a brand new CSS selector engine – nicknamed Sizzle. We wanted an engine that was:

  1. Faster than our current engine for the most commonly used selectors.
  2. Fully extensible (we had to sacrifice some of our extensibility in favor of performance in past versions of jQuery).
  3. Completely standalone.

As far as performance is concerned, we’ve done quite well, coming in about 49% faster than our previous engine:

This is especially surprising considering that the engine in 1.2.6 was already pretty fast and that we gained a great deal of extensibility in the process.

One thing that became very obvious during the development of the new engine: We wanted to be able to collaborate on it with other libraries and developers. We saw an opportunity for some solid collaboration with some of the best JavaScript developers – the result of which will help users of all libraries. For this reason we made sure that Sizzle was able to work completely standalone (no dependencies).

Additionally, as a sign of good faith and willingness to collaborate, we’ve released the source code to Sizzle to the Dojo Foundation. We wanted a common meeting ground where everyone would be able to work together and under which there would be a clear long-term copyright holder.

Right now we’re working with Prototype, Dojo, Yahoo UI, MochiKit, and TinyMCE (and many others) on Sizzle, honing it to perfection.

Live Events

jQuery now supports “live events” – events that can be bound to all current – and future – elements. Using event delegation, and a seamless jQuery-style API, the result is both easy to use and very fast.

More information about live events can be found in the .live() documentation.

When working on live events we wanted a solution that was going to be fast and scale well. To do this we needed a selector engine designed to handle delegation element filtering (roughly speaking “does this selector match this element”). The new Sizzle selector engine blew away all of our expectations – coming in almost 30x faster than our previous solution:

By using advanced filtering techniques we’re able to bring you an event delegation solution that won’t bog down your browser and will scale to dozens or hundreds of delegations on a page at a time.

jQuery Event Object

Ariel Flesler brought some serious refactoring of the jQuery event system to jQuery 1.3. The bulk of this change came down to the new jQuery.Event object. This object completely encapsulates all of the functionality normally found in a W3C-compliant event object implementation and makes it work smoothly across all browsers.

There were a number of individual changes related to the event system, as well, and those are described in-depth later on in the event section.

HTML Injection Rewrite

All of the code related to injecting HTML into a document (such as the append, prepend, before, and after methods) has been overhauled. When we were analyzing jQuery applications we found this to be one of the most common bottlenecks – and thus was in direct need for an improvement. The functionality provided is identical to what was in previous releases of jQuery but with the added benefit of being much, much faster (about 6x faster overall):

We also overhauled the creation of DOM elements (e.g. $("<script/>")) and made it identical to calling $(document.createElement("script")) (it’s both faster and saner as a result).

Offset Rewrite

Brandon Aaron felt that a full rewrite of the .offset() method was due for 1.3. Re-written from scratch, it not only handles cross-browser issues better, but does so much faster:

Seeing an almost 3x jump in performance over the offset method in 1.2.6 this rewrite is sure to make your complex interactions go that much more smoothly.

No More Browser Sniffing

The final major feature of this release is one that you probably won’t ever see or deal directly with but it’s an important change that’ll help to make jQuery last longer and with less bugs: As of 1.3, jQuery no longer uses any form of browser/userAgent sniffing internally – and is the first major JavaScript library to do so.

Browser sniffing is a technique in which you make assumptions about how a piece of code will work in the future. Generally this means making an assumption that a specific browser bug will always be there – which frequently leads to code breaking when browsers make changes and fix bugs.

Instead we use a technique called feature detection where we simulate a particular browser feature or bug to verify its existence. We’ve encapsulated all the checks that we use in jQuery into a single object: jQuery.support. More information about it, feature detection, and what this feature provides can be found in the documentation.

It’s important to note that jQuery.browser is still in jQuery – and will be for the foreseeable future (too many plugins and pieces of code depend on it). That being said we’ve deprecated it in an attempt to encourage you – and all JavaScript developers – to seriously consider using feature detection in your code.

Upgrading

With jQuery 1.3 we attempted to minimize any large upgrade hassles – maintaining all existing public APIs. That being said, please read through the list of potentially-breaking changes to be aware of what might cause problems in your applications.

Note: Many plugins are providing updated releases to coincide with jQuery 1.3. If you’re having difficulties with a particular plugin please be sure to see if a new release has arrived. Specifically both jQuery UI and the Validation plugin have updated releases that work with jQuery 1.3.

Downloading

As usual, we provide two copies of jQuery, one minifed (we now use YUI Compressor as the default minifier) and one uncompressed (for debugging or reading).

http://code.jquery.com/jquery-1.3.min.js jQuery Minified (18kb gzipped)
http://code.jquery.com/jquery-1.3.js jQuery Regular (114kb)

Additionally, Google has provided us with a copy of jQuery hosted on their servers. This copy of jQuery is automatically minified and gzipped – and served from Google’s fast edge cache servers.

http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js

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

Changes

The following are changes that were made that may have a remote possibility to cause backwards compatibility issues in your web pages.

  • The ‘@’ in [@attr] has been removed. Deprecated since 1.2 this old syntax no longer works. Simply remove the @ to upgrade.
  • Triggered events now bubble up the DOM. Unsuspecting event handlers may accidentally capture more events than they’re expecting.
  • The ready() method no longer tries to make any guarantees about waiting for all stylesheets to be loaded. Instead all CSS files should be included before the scripts on the page.
  • .isFunction is simpler now, it no longer handles some strange edge cases (in favor of simplicity and performance).
  • The order of “a, b, c” style selectors may change. Browsers that support querySelectorAll (Safari, Firefox 3.5+, Opera 10+, IE 8+) will return the elements in document order, other browsers will (currently) return them in the order specified. In 1.3.2 and later release all comma-separated selectors will be returned in document order.
  • The trigger and triggerHandler methods no longer accept event objects within the data array. Instead they should be specified directly as an argument.
  • The undocumented ‘extra’ function is gone from trigger and triggerHandler functions as well.
  • The internal jQuery.event.trigger no longer returns the last item returned by a handler, instead it return true or false as per the W3C specification. You should use a jQuery.Event object to capture the specific return value.
  • You should always be sure to run your page in standards mode. There are known issues with methods not working correctly in quirks mode.
  • An old (deprecated) style of creating selector plugins has been removed. Previously you could create string-encoded plugins which were later turned into functions – this has been removed – please just create the functions directly.
  • jQuery.param(obj) execute obj’s functions instead of converting them to a String.

The following properties have been deprecated (in favor of feature detection and jQuery.support, as discussed in the Overview: jQuery.browser, jQuery.browser.version, jQuery.boxModel.

The following browsers are no longer supported: Safari 2

Performance

To measure the performance of different portions of jQuery we used a modified copy of the SlickSpeed test suite to run our tests (adapted to handle non-selector tests). The raw results for the test runs can be found below (all times in milliseconds).

We used a copy of the Yahoo home page (a representatively complex web page) and used a selection of selectors that people actually use. Targeting selectors that people currently use will help to improve the performance of both existing and future applications.

Frameworks	jQuery 1.2.6	jQuery 1.3	Dojo 1.2.3	MooTools 1.2.1	Prototype 1.6.0.3
Firefox 3	184		111		147		240		137
Firefox 3.5	113		34		105		135		55
Safari 3.2	71		15		64		76		50
Safari Nightly	46		15		65		47		18
Opera 9.6	107		75		73		132		87
IE 6		854		640		561		1611		3174
IE 7		210		181		150		490		761
Chrome		30		13		23		118		10

Delegation Filtering Tests

To test delegation filtering we attempted to see if a given element matched a selector. jQuery 1.3 and Prototype provided native methods for handling this (.is and .match, respectively) whereas jQuery 1.2.6, Dojo, and MooTools all used a “run a selector and see if an element is in the results” technique.

Frameworks	jQuery 1.2.6	jQuery 1.3	Dojo 1.2.3	MooTools 1.2.1	Prototype 1.6.0.3
Firefox 3	3260		199		1630		3798		763
Firefox 3.5	1047		113		620		1101		298
Safari 3.2	1169		91		820		1223		188
Safari Nightly	911		65		294		590		125
Opera 9.6	1764		167		898		1976		451
IE 6		22142		1201		13000		17227		12827
IE 7		4908		341		2664		5497		2994
Chrome		959		125		700		939		153

DOM Manipulation Tests

These tests analyze the performance of inserting DOM fragments (in the case of jQuery and Prototype this is HTML, for MooTools it was using their Element class). Dojo didn’t provide any explicit helpers for injecting HTML or constructing DOM elements so it was excluded.

Frameworks	jQuery 1.2.6	jQuery 1.3	MooTools 1.2.1	Prototype 1.6.0.3
Firefox 3	161		41		47		323
Firefox 3.5	113		31		42		78
Safari 3.2	77		10		25		41
Safari Nightly	87		22		22		31
Opera 9.6	130		23		36		84
IE 6		710		110		600		971
IE 7		560		60		330		460
Chrome		49		14		23		21

.offset() Tests

Ran the jQuery .offset() method on a number of elements.

Frameworks	jQuery 1.2.6	jQuery 1.3
Firefox 3	142		30
Firefox 3.5	45		23
Safari 3.2	92		18
Safari Nightly	75		39
Opera 9.6	39		26
IE 6		151		70
IE 7		100		50
Chrome		115		21

.hide()/.show() Results

Ran the .hide() and .show() methods on a number of elements.

Frameworks	jQuery 1.2.6	jQuery 1.3
Firefox 3	2680		722
Firefox 3.5	1867		448
Safari 3.2	1015		577
Safari Nightly	532		306
Opera 9.6	2327		1173
IE 6		8242		2715
IE 7		1912		961
Chrome		1922		551

jQuery 1.3 and the jQuery Foundation

Posted on by

Happy Birthday to jQuery! jQuery is three years old today, after being released way back on January 14th, 2006 at the first BarCampNYC by John Resig.

We have four announcements for you today, we hope you’ll enjoy them!

jQuery 1.3

First, we have an excellent new release of jQuery ready for you to enjoy. The big features of this release are:

  • Sizzle: A sizzlin’ hot CSS selector engine.
  • Live Events: Event delegation with a jQuery twist.
  • jQuery Event Overhaul: Completely rewired to simplify event handling.
  • HTML Injection Rewrite: Lightning-fast HTML appending.
  • Offset Rewrite: Super-quick position calculation.
  • No More Browser Sniffing: Using feature detection to help jQuery last for many more years to come.

The full details of the release can be found in the release notes:
http://docs.jquery.com/Release:jQuery_1.3

We’re currently planning on a follow-up jQuery 1.3.1 release sometime within the next week or two to catch any straggling bugs that might’ve slipped through. If you spot any bugs please be sure to submit them to the bug tracker.

Sizzle

jQuery has a brand new CSS selector engine – nicknamed ‘Sizzle‘. You can read the full details behind it in the jQuery 1.3 Release Notes (including performance numbers).

More importantly, though, we’re taking a big leap with Sizzle: We’re releasing it as a completely standalone project to be collaborated upon by many library creators and developers. We saw an opportunity to give something back to not just the jQuery community but to the JavaScript development community as a whole; and at the same time be able to collaborate with developers of other libraries on a single, unified, selector engine. We feel that there’s too much competition and not enough collaboration occurring and so we put our code out on the line as a good first step towards working together.

As a sign of good faith and willingness to collaborate, we’ve turned over Sizzle to the Dojo Foundation (an excellent non-profit well suited for this project, not to be confused with the Dojo Toolkit). We wanted a common meeting ground where all developers would be able to work together and under which there would be a clear long-term copyright holder.

Our request for collaboration has already seen an amazing resopnse: Developers from Prototype, Dojo, Yahoo UI, MochiKit, and TinyMCE (and many other projects) have all shown interest in refining Sizzle to perfection.

A rough Sizzle project page can be found here:
http://sizzlejs.com/

Along with the full source code:
http://github.com/jeresig/sizzle/tree/master

New API Browser

Along with the release of jQuery 1.3, I’m pleased to present the new API browser, developed by Remy Sharp, available at: http://api.jquery.com/.

jQuery API Browser
This is an alternative view to the existing jQuery API that should be easy to navigate and use.

The new API browser includes the following features:

  • All the latest jQuery and jQuery UI documentation.
  • The ability to mark pages as favorites for those pages you keep wanting to return to.
  • Syntax highlighting in the code examples
  • Live running of examples within the browser
  • Links to edit and experiment with the code examples

Most importantly though, the API browser is also available offline as an Adobe AIR application (thanks to Tane Piper’s AIR framework). The interface looks and works the same, and includes an auto-update mechanism, so you’ll always be up to date.

Download and install the AIR API browser

If you find problems please submit a bug to the bug tracker under the ‘site’ component.

Which leads us to the last, and certainly not the least important, point…

jQuery Foundation

With the jQuery Project growing at a tremendous rate, it was important for us, as a team, to take a step back and determine how the project’s ownership should be handled. Currently, John Resig, jQuery’s founder and lead developer, and Paul Bakaus, lead developer for jQuery UI, both maintain ownership of their respective projects. This posed several concerns from a practical and legal perspective as it enjoined two individuals as the owners of the projects instead of a formal organization. As more individuals and corporations started contributing to the projects, these concerns became even more evident causing confusion as to who were the correct copyright holders for specific units of work.

After meeting up to talk at the recent jQuery Conference, we decided to really make a concerted effort to fix this and determine how we could shift ownership of the jQuery projects to a foundation-type organization that would:

1. Understand the nature of open-source software development.
2. Allow us to continue to manage the project unhindered.
3. Ensure that the projects continue to live on regardless of who is involved in the effort.

After examining many options we came to a final conclusion – and we’re excited to announce that the Software Freedom Conservancy has extended the jQuery project an invitation to join the non-profit organization and continue developing software under its auspices. By joining The Software Freedom Conservancy, the jQuery projects and community immediately realize some important benefits:

1. It allows the current project members to continue to manage the projects and maintain ultimate responsibility for the direction of current and future efforts.
2. It allows the projects to be considered a true non-profit efforts allowing us to be able to accept donations and contributions without incurring tremendous personal financial liability.
3. The copyright of the code will be assigned to the conservancy thus ensuring that no single person will own contributions or assets of the project.
4. It may allow corporations to write off time when an employee contributes to a project.
5. Most importantly, it ensures that the jQuery projects will always be open and free software.

This is a big step in formalizing the jQuery projects and an important accomplishment in ensuring that the investment being made by the jQuery community is protected. We’ll be making the transition into the conservancy over the coming weeks. There will be very little, to no, change in how the project will run. The jQuery Team will still run and manage the project and we’re still going to work hard to build the best JavaScript library possible. If anything this will help to free up some of our time so that we can spend more time coding – and who doesn’t like the sound of that?

Happy 3rd birthday, jQuery!