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!

jQuery Conference 2008 Agenda

Posted on by

The sold-out jQuery Conference 2008, being held in Boston at the MIT Stata Center on September 28th, is nearly upon us. With 13 sessions being delivered by the jQuery team as well as prominent industry experts such as Jonathan Snook, Aza Raskin and Cody Lindley, this is sure to be a stellar event.

The conference has been broken out into two tracks, Beginner and Advanced, to allow developers of various jQuery expertise to take full advantage of the sessions that will be suit their needs. Below you will find the agenda for the conference. In the interest of sharing information, we wanted to put up the agenda as soon as possible. We will be releasing another page shortly that will provide topic descriptions as well as bios for each of the speakers.

Featured Presenters:

John Resig

John Resig

John Resig is the creator and lead developer of the jQuery JavaScript library. He’s also a JavaScript Evangelist for the Mozilla Corporation and the author of the book Pro JavaScript Techniques.

Currently, John is located in Boston, MA. He’s hard at work on his second book, Secrets of the JavaScript Ninja, due in bookstores Late 2008.

Joern Zaefferer

Joern Zaefferer

Jörn Zaefferer is a member of the core jQuery team. Along his work on jQuery itself, he wrote and maintains several of the most popular jQuery plugins. Jörn Zaefferer works as a consultant for maxence integration technologies GmbH in Cologne, Germany, where he architects and develops Java-based web applications for maxence’s customers and maxence’s own products.

Jonathan Snook

Jonathan Snook

Web designer and developer, Jonathan Snook moves effortlessly from client-side, front-end work to hardcore server-side challenges, and his fluency in CSS, JavaScript, PHP and MySQL make make him the “turn-to” man for many high-profile clients. Coauthor of Accelerated DOM Scripting and The Art and Science of CSS, he writes regularly at his popular blog snook.ca, and for Digital Web and Sitepoint. Jonathan also works with his partners at Sidebar Creative, makers of world-class websites and innovative applications.

Richard Worth

Richard Worth

Richard D. Worth is a Web developer in the Washington, DC area. He works for Fulcrum IT on web services contracts, primarily for the government. Richard is one of the lead developers of jQuery UI, a component framework built on top of jQuery, designed to make Rich Internet Applications as simple as jQuery has made Ajax. Richard is also a contributing author on dmxzone.com, writing regular beginner and advanced jQuery UI articles, and has been selected as a Technical Reviewer for a book on jQuery UI to be published in the fall.

Paul Bakaus

Paul Bakaus

Paul Bakaus is a UI architect living in Germany. He’s the creator and lead of jQuery UI and works for the open source company Liferay in a full-time sponsored position to jQuery UI. He’s responsible for the overall direction and roadmap of jQuery UI and he enjoys speaking about his user interface work in many places of the world. He’s also a member of the jQuery core team and takes part in the discussion of the overall direction of the jQuery project. In the past, he was largely responsible for creating the jQuery dimensions plugin (which is now part of the jQuery core) and worked together with Stefan Petre on the rich effects and components library Interface.

Yehuda Katz

Yehuda Katz

In addition to being the co-author of jQuery In Action, Yehuda Katz is a contributor to Ruby in Practice and co-author of the upcoming Merb in Action. He is a core contributor to DataMapper and jQuery. Before coming to Engine Yard, he worked for on a construction management tool written in Ruby on Rails and jQuery. Yehuda is a Merb core developer, contributes to Rubinius, and is taking a lead role in the development of Engine Yard’s new Control Panel.

Aza Raskin

Aza Raskin

Aza Raskin is the founder of Humanized (now part of Mozilla), Songza, and Bloxes. The son of Apple software pioneer Jef Raskin, he brings a keen interest in human interface design to everything he does.

Karl Swedberg

Karl Swedberg

After having taught high school English, edited copy for an advertising agency, and owned a coffee house, Karl Swedberg began his career as a web developer three years ago. He now works for Fusionary Media in Grand Rapids, Michigan, where he specializes in client-side scripting and interaction design. Karl is an “Evangelist” for the jQuery JavaScript Library and the co-author of two books, Learning jQuery and jQuery Reference Guide.

Scott Jehl

Scott Jehl

Scott Jehl is a designer at Filament Group, a Boston, MA studio specializing in web application design and development. At Filament, Scott and his colleagues frequently contribute design and code to the jQuery community, and recently built ThemeRoller, a theme design application for jQuery UI. Scott leads the design team at jQuery, and runs WriteMaps, an ajax web application for building visual website sitemaps. He enjoys wake/skate/snowboarding, being outdoors, and spending time with his wife Stephanie and their two cats.

Jonathan Sharp

Jonathan Sharp

Jonathan Sharp is a standards driven freelance web designer and developer. With experience in both frontend and backend technolgoies he brings value in integration delivering a seamless user experience. Jonathan has also developed a number of jQuery plugins such as jdMenu, jdNewsScroll and positionBy. Prior to freelancing, Jonathan worked for Union Pacific Railroad, CSC and Motorola, Inc. in Chicago after helping found Imprev, Inc. in Bellevue, WA in early 2000. He lives in Nebraska with his wife, Erin, and their daughter Noel. When not working he enjoys spending time with his family, playing with their dogs, and riding off into the sunset on Micah, his draft horse.

Kevin Hoyt

Kevin Hoyt

Kevin Hoyt is a Platform Evangelist with Adobe Systems, Inc. Passionate about engaging user experiences, you’ll most often find him meeting with customers, speaking at conferences, presenting online seminars, or just enjoying the chance to share ideas and brainstorm with other developers. When not on the road, Kevin enjoys spending time with his family, photography and general aviation.

Cody Lindley

Cody Lindley

Cody Lindley is a Christian, husband, son, brother, professional web developer, and outdoor enthusiast. He spends the majority of his time sleeping and working, but who doesn’t? In between the daily routines of the average American, he desires an existence that entails a relationship with God, family, and nature. He considers himself a bookworm and a novice theologian, but truth be told, he simply enjoys watching movies and playing Xbox way too much. He is thankful for the luxury of pursuing his profession as a personal passion. More details can be found about cody on his site codylindley.com.

Mike Alsup

Mike Alsup

Mike Alsup is a Senior Developer at Click Commerce in Rochester, NY. He has been developing software solutions for 15 years with a current focus on Java, Swing, J2EE and web applictions. Involved with the jQuery project since near its inception in early 2006, Mike has authored many popular plugins including the Form Plugin, BlockUI, Taconite and Cycle.

Agenda:

Beginner Advanced
9:00 – 9:30
Registration, Breakfast
9:30 – 9:55
State of jQuery – John Resig
10:00 – 10:50 Learning jQuery – Karl Swedberg Optimizing jQuery Core – John Resig
11:00 – 11:50 jQuery Case Studies – Cody Lindley
and Jonathan Snook
Writing Scalable jQuery Applications – Yehuda Katz
12:00 – 1:00
Lunch
1:00 – 1:50 Rich Interactivity, Simplified with jQuery UI – Richard Worth An In-Depth Look at jQuery UI – Paul Bakaus
2:00 – 2:50 Designing Reusable jQuery Components – Scott Jehl Desktop Applications with jQuery and Adobe AIR – Kevin Hoyt
3:00 – 3:50 Making the Case for jQuery – Jonathan Sharp Using jQuery in Firefox Extensions – Aza Raskin
4:00 – 4:50 Your First jQuery Plugin – Mike Alsup Building Robust jQuery Plugins – Joern Zaefferer
5:00 – 6:00
Dinner
Later
Cambridge Brewing Company for drinks and socializing

Full details of the individual sessions, biographies of the speakers, and additional conference information is forthcoming.

jQuery Site Redesign – The Community Speaks

Posted on by

As many of you have seen by now, the jQuery Project’s site has been redesigned. It had been a long overdue task and it was important to put a fresh new spin on the main hub, and the face, of jQuery. One of the things about the jQuery Project is that we’ve never run with the crowd or accepted the norm. By pushing boundaries and sometimes being “in your face” we’ve not only grown tremendously in popularity but we’ve pushed most of the other JS library projects to rethink their own principles and make changes to improve their products. That’s a good thing for everyone as competition is always good.

So, it should come as no surprise by the drastic change in the jQuery website. So far, the single biggest complaint has been associated with the new banner (ie: rockstar caricature & slogan). Again, we wanted to push the boundaries and come up with something that would generate a lot of buzz. Overall, we’ve succeeded in that goal with plenty of positive feedback but unfortunately, with some very negative comments as well. We actually value both types of feedback and want more as it’s the only way to determine if we’re on the right track. As with any site redesign, you can’t please everyone and we understand that. But we also want everyone to realize that this is a first cut and it doesn’t mean that it can’t be tweaked.

We’re actively reviewing all of the feedback and will certainly be looking at how to best handle some of the concerns of the community. After all, the community is what makes the jQuery Project so special and so different from other projects. In addition, the jQuery team has always listened to the needs of the community and this time is no exception. Again, I think the team is unique in that we *DO LISTEN* to the community and we’re going to work on making the site an invaluable tool for everyone. So just give us some time to go through the messages and keep an eye on this blog for updates.
Thanks for your patience and we truly appreciate your feedback.

Registration Open for jQuery Conference 2008

Posted on by

Registration for jQuery Conference 2008 is officially open. Register now to ensure your spot!
As announced, this one-day conference will be held in Boston on Sunday, September 28, and will feature two tracks of presentations (beginner and advanced) from jQuery project members and a few special guest speakers. A registration fee of $50 will help cover the cost of the venue, as well as food, beverages, and T-shirts for all attendees.

We’re finalizing a convenient venue, especially for those who will be attending The Ajax Experience conference the following Monday through Wednesday. We’re still firming up the agenda as well, but you can expect this to be a blow-out event.

If you have any questions, please feel free to contact us at events [at] learningjquery.com

jQuery Camp 2008 Announced

Posted on by

The jQuery Team is pleased to announce the second annual jQuery Camp! jQuery Camp 2008 will be held on Sunday, Sept. 28, the day before The Ajax Experience, in Boston, MA (location TBA).

Last year, over 100 jQuery developers gathered for a full day of jQuery sessions, which included talks from such big names as jQuery creator John Resig and other core team members, as well as talks from expert users exploring new and exciting jQuery projects. It brought together the largest group of jQuery Core Team members ever assembled, and gave users the opportunity to pick their brains and pitch new ideas.

The event was a *clear* success, and this year’s camp promises to be even better.

jQuery Camp 2008 will offer two tracks, providing both introductory and advanced sessions, covering a variety of topics. Ajax development, mashups, security and the recently released jQuery UI component and effects library are just some of the topics already lined up.

jQuery Camp 2008 will charge a nominal fee of $50 per person, which will include lunch. Attendees need NOT be registered for The Ajax Experience to attend. Registration will open in July; keep an eye on jQuery.com for more details!

For those attending The Ajax Experience, show organizers have recently announced a half-day time slot for additional jQuery sessions, on September 29th at the conference center. The agenda is still up in the air, but we’re thinking of offering a “Dream Team Code Review” session, where users can have code reviewed by members of the jQuery team. We’re interested in your feedback; would you attend this session?

jQuery Camp 2008 is a truly fantastic opportunity to learn from the jQuery team and socialize with top jQuery developers; we’re looking forward to meeting everyone!

See you all in September.

jQuery 1.2.6 Released

Posted on by

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

This is the next release immediately following jQuery 1.2.3. Releases 1.2.4 and 1.2.5 were skipped (1.2.4 was built incorrectly, rendering it effectively identical to 1.2.3, and 1.2.5 was missing a patch).

The entire jQuery team did a fantastic job in pulling this release together – I want to take this opportunity to thank them all for their continued hard work.

I’d also like to take this opportunity to welcome Ariel Flesler to the core jQuery development team. He provided valuable help in pulling this release together – contributing bug fixes, performance improvements, features, and test cases. You can see the result of his hard work all throughout this release. Welcome Ariel and thank him for all his contributions!

Downloading

jQuery 1.2.6:

Performance Improvements

Once again the jQuery team has worked hard to bring huge performance improvements in this release. As with previous releases we’ve expanded to look at many areas of the jQuery framework, looking for common pain points, and providing relief.

All data and test cases for the below performance improvements can be found in the following jQuery 1.2.3 v. 1.2.6 Google Spreadsheet (results for Internet Explorer 6 were excluded in favor of Internet Explorer 7 due to their virtually-identical results).

Event Handling is 103% Faster

In analyzing intense application code (specifically operations such as drag-and-drop) we looked for ways in which universal changes could be made that would affect all users. A frequently-called piece of code was that of the jQuery event handler, any optimizations to it would dramatically improve the performance of all resulting frequently-called events. By focusing improvements here all frequently-called events that you have should see immediate benefits.

CSS Selectors are 13% faster

A number of optimizations have been made to internal jQuery methods, dramatically improving their performance, while providing measurable benefit to some of the most commonly used code in jQuery (such as the CSS Selector code).

For example the jQuery.map() method is now 866% faster and jQuery.extend() is 19% faster. These two changes have allowed for dramatic improvements in performance all throughout the library.

.offset() is 21% faster

Together with the improvements to jQuery’s event handling code optimizations of .offset() have allowed intense mouse-based operations to become much faster. For example jQuery UI’s drag-and-drop code is now over 300% faster because of these change (allowing you to achieve faster, smoother, drag-and-drop operations).

.css() is 25% faster

A method that’s frequently called (both internally and externally). The optimizations to this method are easily felt in others (like .offset(), for example).

New Features and Major Changes

Dimensions Plugin is Now Part of Core

The remaining methods of the Dimensions plugin, by Brandon Aaron, have been introduced into jQuery core, along with additional bug fixes and performance improvements. This plugin has seen considerable use amongst developers and plugin authors and has become a solid part of the jQuery ecosystem. We’ve been, slowly, introducing the most-used methods from the Dimensions plugin over the past couple releases – but with the release of 1.2.6 all remaining methods are now part of core.

If you’re upgrading your copy of jQuery to version 1.2.6 you can now opt to exclude the Dimensions plugin from your code.

The full documentation for Dimensions can be found on the jQuery API docs site (and is in the process of becoming integrated with the core jQuery documentation).

.attr() overhaul

The .attr() method has been completely overhauled (resolving about 15 outstanding bugs). Additionally, the method has been significantly simplified and optimized.

.toggle() can now accept more functions

Historically jQuery’s .toggle() function has accepted two functions (to be toggled in an even/odd manner). However that has been changed so that any number of functions can be provided and toggled by a mouse click.

$("div").toggle(function(){
  $(this).removeClass("three").addClass("one");
}, function(){
  $(this).removeClass("one").addClass("two");
}, function(){
  $(this).removeClass("two").addClass("three");
});

You can now unbind bound .toggle() and .one() functions

function test(){ $(this).addClass("test"); }
$("div").one("click", test);
$("div").unbind("click", test);

$("div").toggle(test, test);
$("div").unbind("click", test);

.index() supports jQuery collections

jQuery’s .index() function has allowed you to find the location of a DOM element in the jQuery collection – now you can also specify a jQuery collection (the first element of which will be extracted and located in the original set).

var test = $("div.test");
$("div").index( test ) == 3

jQuery.makeArray can convert ANYTHING to an array.

jQuery’s internal .makeArray() method now converts any array-like object into a new array. Additionally it wraps all other objects as an array and returns the resulting set.

jQuery.makeArray( document.getElementsByTagName("div") )
// => [ div, div, div ]

jQuery.makeArray( true )
// => [ true ]

jQuery.makeArray()
// => []

beforeSend can cancel Ajax calls

The beforeSend Ajax callback has allowed developers to execute a piece of code prior to a request occurring – now that code can also verify the integrity of some parameters and cancel the resulting Ajax request (useful for tasks like form validation).

$.ajax({
  beforeSend: function(){
    return $("#input").val() == "";
  },
  url: "test.php"
});

Exposed Speeds

jQuery has a number of named animation speeds (such as ‘slow’, ‘fast’, and ‘default’) you can now provide your own names for animation speeds, or modify the existing ones, by manipulating the jQuery.fx.speeds object.

jQuery.fx.speeds.slow = 1000;
$("#test").slideDown("slow");