14 Days of jQuery Summary: Days 8-14, jQuery 1.4.1 Released

Posted on by

In case you’re not following along with the 14 days of jQuery, here’s a summary of what has been released for days 8-14.

Highlights

On Day 12, the jQuery team released jQuery 1.4.1, the first bug release to jQuery 1.4. jQuery 1.4.1 is now the latest release of jQuery; take a moment to review the 1.4.1 release notes.

On Day 13, the team announced the new jQuery Meetups site. We want to help foster local meetups and eventually try to provide more resources to your groups.

jQuery Meetups

On Day 14, the jQuery UI team released jQuery UI 1.8 Release Candidate 1. The team would love you to test and provide feedback with bugs or comments in the jQuery UI Development forum.

Full Recap

Day 8

  • The jQuery Project
  • jQuery.org

Day 9

  • jQuery Workshop Giveaway
  • jQuery Podcast Episode 8: api.jquery.com
  • jQuery 1.4 Hawtness #3, with Paul Irish
  • jQuery API Key Navigation

Day 10

  • jQuery 1.4 Hawtness #4, with Paul Irish

Day 11

  • Evented Programming with jQuery, Yehuda Katz
  • Behind the 14 Days of jQuery

Day 12

  • jQuery 1.4.1 Released
  • jQuery 1.4 Hawtness #5, with Paul Irish

Day 13

  • jQuery Meetups
  • jQuery 1.4 Hawtness #6, with Paul Irish
  • Paul Irish and Dave Methvin Join the jQuery Team

Day 14

  • jQuery UI 1.8rc1

Sponsors and Donations

Again, events like these are not possible without support from our great sponsors and from you, the jQuery Community. We’d like to thank everyone who has donated during this campaign. We received donations from 653 people, and we are truly grateful to all who contributed. If you missed the campaign, you can still let us know how much jQuery makes your life easier by sending a tax-deductible donation or by showing our sponsors some love for their support.

Netflix

Netflix, Inc. (NASDAQ: NFLX) is the world’s largest online movie rental service, with more than 11 million subscribers. For only $8.99 a month, Netflix members can instantly watch unlimited movies and TV episodes streamed to their TVs and computers and can receive unlimited DVDs delivered quickly to their homes.

JupiterIT

Jupiter provides expert web application development, support services, and training. Committed to open source, Jupiter collected its global experience delivering enterprise JavaScript applications and made it publically available as JavaScriptMVC.

appendTo

appendTo, the jQuery company, delivers industry-leading jQuery training and support services to the web development community and corporations worldwide. Leveraging the power of the Write Less, Do More JavaScript library and the vast experience of jQuery Team Members, appendTo is at the forefront of propelling the jQuery movement into the next generation of open source technology advancements

Oxide Design

Oxide Design Co. is a communications and information design firm. We specialize in corporate identity, brand strategy, packaging, print, and web site design. We clarify ideas to create effective design.

Fusionary

We are Fusionary, an award-winning web and interactive studio. We’ve been creating things online since 1995 and our clients love us.

The team hopes you enjoyed this online conference celebrating the 1.4 release of jQuery. We would love to hear your feedback. Please submit your feedback in this thread on the new jQuery Forum.

jQuery.org

Posted on by

Today we’re pleased to announce the brand new jQuery.org web site: The home of the jQuery project.

jQuery.org

The jQuery.org site was designed and implemented by jQuery community member Boaz Sender.

You may recognize most of the content from the old jQuery Docs site but it’s been heavily re-organized and presented in a manner more befitting of the larger jQuery project.

jQuery.org: Team jQuery.org: History jQuery.org: About

jQuery.org: License jQuery.org: Donate

This launch goes along with the formalization of the jQuery project, back from when we joined the Software Freedom Conservancy. Having an official home for the larger jQuery project should be good for future growth and organization in the project as a whole. You can learn more about this organization in this video about the jQuery project.


Originally published at 14 Days of jQuery (archived).

New jQuery Forum

Posted on by

Today we’re officially announcing the brand new jQuery Forum. We’ve been using mailing lists, and subsequently Google Groups, over the past 4 years to manage the discussion and community around jQuery. That particular solution has simply not been able to scale to our discussion requirements both in terms of participation and in managing spam.

New jQuery Forum

When looking for a new area to have discussions, we looked at a wide variety of solutions with a few major requirements: It had to be capable of handling both regular discussions and the now-ubiquitous question & answers that occur. Additionally, we wanted something that lowered the barrier to asking a question — something that anyone would be able to use (thus it had to have a good web interface).

We also wanted a solution that would have a low maintenance threshold for the team. This would mean either using a hosted solution in which the team we were working with was very accommodating or using a solution that we host ourselves that was trivially easy to use and had a good community of developers.

We ended up analyzing countless solutions, but in the end we chose to go with Zoho Discussions (Zoho’s announcement about the move). A combination of decisions drove us to this decision:

  • Zoho Discussions seamlessly integrates both regular, forum-style, discussions and Q&A. Additionally, all the moderation and administration tools are designed around building and managing a slick workflow for answering questions and concerns.
  • The Discussions team at Zoho have been incredibly accommodating. They are not only providing all the hosting for free but going out of their way to fix concerns and integrate our full Google Groups back history. We’ve been working very closely with them, and they’ve fixed, or are fixing, every issue that we’ve brought forward.

The jQuery team has transitioned to using the new forum over the past week and have been very pleased with how it’s been working out thus far. Most of the old Google Groups and all of the old jQueryHelp.com posts have been integrated into the new system. We will be doing a final import of the Google Groups posts once we finally close the groups in the next week or two.

We’ve opened up a number of individual forums for discussion.

As time goes by, we’ll certainly open more as needs arise — especially ones for non-English speaking users.

As it stands the two largest outstanding issues that are being actively worked on are:

  • There is no way to receive email updates of all posts. You can receive email updates for individual posts that you subscribe to, and you receive email updates for posts that you create, but it’s not possible to subscribe to all of them simultaneously. In the meantime we recommend that you subscribe to the forum RSS feed as a way to see all posts and replies.
  • Many of the pages on the site are being loaded in an “Ajax” manner which is being replaced with a more traditional (and appropriate) page load. The full transition should be complete very soon.

We’ve collected a number of smaller issues and are communicating actively with the Zoho Discussions team. If you find any more issues please feel free to post them to the About the jQuery Forum forum.

As mentioned before, we analyzed a number of discussion solutions — dozens, in fact. There are a few that we were quite pleased with and were in the final running.

  • Stack Overflow is pretty much the undisputed king of web-based Q&A. There is already an active community of jQuery users there, as well. We looked at both adopting the existing Stack Overflow community and setting up a Stack Exchange as possible solutions. However, both of those left a major gap: They were not suited to handling regular, non-Q&A, discussions. If we were to use either of those solutions, we would have to set up an additional forum or mailing list just to have plain discussions. In the end we decided to not move ahead with these solutions in favor of something that provided a more-unified community.
  • We also looked at many traditional forum solutions such as Vanilla Forums. Out of all the ones that we looked at, Vanilla Forums proved to be the best structured towards our needs. With an active and organized plugin community, we were able to find many solutions to our problems. However, in the end there was no good way to provide consistent Q&A using Vanilla, or a set of plugins, exclusively. We would end up having to use it in conjunction with Stack Overflow or another service. Also, we would have to host and develop the solution completely by ourselves, which requires time that we would rather spend in other ways.
  • We also looked at better mailing list solutions, like Librelist, but they don’t provide any sort of simple web interface (at least not in the way that forum solutions do), making it very difficult for new users to participate and get questions answered. We really have no interest in going back to the old discussion techniques of Google Groups and other mailing list providers.

We want to take this opportunity to thank the Zoho Discussions team for all their hard work in helping us transition over to their software. They’ve been incredibly helpful and we’re very excited to to be working with them.

Additionally we want to thank Chrys Bader, Mike Branski, and the rest of the community at the old jQueryHelp.com forum for being supportive and willing to integrate into the new forum setup.

Thanks again to everyone for their help in this transition. We hope to work out most of the kinks very quickly and are looking to smooth sailing from here on out. Feel free to hop onto the forums and be sure to report any problems that you may have.


Originally published at 14 Days of jQuery (archived).

14 Days of jQuery Summary: Days 1 – 7

Posted on by

In case you’re not following along with the 14 days of jQuery, here’s a summary of what has been released thus far.

Pre Release Day 1

  • New jQuery API Site

Pre Release Day 2

  • jQuery 1.4rc1

Day 1

  • jQuery 1.4 Released
  • jQuery 1.4 Live Q&A

Day 2

  • HD version of jQuery 1.4 Q&A
  • Media Temple Giveaway
  • jQuery Podcast episode 7 with John Resig

Day 3

  • Internal Changes in jQuery 1.4, with John Resig

Day 4

  • Getting Involved in the jQuery Community, with Karl Swedberg

Day 5

  • appendTo Training Drawing
  • jQuery 1.4 Hawtness #1, with Paul Irish

Day 6

  • jQuery In The Enterprise

Day 7

  • New jQuery Forum
  • jQuery 1.4 Hawtness #2, with Paul Irish

We still have 7 more days of jQuery 1.4 to come with more video’s and more releases to announce.

Again, events like these are not possible without support from our great sponsors and from you, the jQuery Community. We’d like to thank everyone who has donated so far, and we’d like to remind everyone that you will receive a free ebook with the donation of $20 or more throughout the 14 Days of jQuery.

Media Template Giveaway

Each day during the 14 days of jQuery, a web developer will receive a free (gs) Grid-Service account for one year from the jQuery Project’s web hosting provider, Media Temple. A grand prize winner will receive a 13″ MacBook Pro!

In order to enter the contest, you must submit a link to your coolest use of jQuery. A winner will be chosen each day during the 14 Days of jQuery. The grand prize winner will be announced on Friday, January 29th.

Check the Media Template Giveaway webpage for more details about the contest and to see the announced daily winners. There are only 7 days left, so enter now!

Check out jQuery Enlightenment!

jQuery EnlightenmentjQuery team member Cody Lindley has published the jQuery Enlightenment book, and if you haven’t checked it out yet, you’ll definitely want to. “Each chapter contains concepts essential to becoming a seasoned jQuery developer,”‘” so even if you’ve already got your copy, pick one up for a friend who’s just learning! Even better, a percentage of all sales goes directly back to the jQuery project and helps fund future releases and projects. A big thank you to Cody for his generous donation for the 14 Days of jQuery campaign!

jQuery 1.4 Released

Posted on by

In celebration of jQuery’s 4th birthday, 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 into this release, and we’re really quite proud of it.

I want to personally thank Brandon Aaron, Ben Alman, Louis-Rémi Babe, Ariel Flesler, Paul Irish, Robert Katić, Yehuda Katz, Dave Methvin, Justin Meyer, Karl Swedberg, and Aaron Quint who put a lot of work into fixing bugs and getting the release out the door.

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

NOTE: jQuery 1.4.1 has already been released. Please use that instead of the 1.4 release.

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.

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.

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

Features

Below is an overview of all the changes and functionality added to jQuery 1.4. Additionally all of the changes have been documented in the jQuery 1.4 docs.

Performance Overhaul of Popular Methods

Many of the most popular and commonly used jQuery methods have seen a significant rewrite in jQuery 1.4. When analyzing the code base we found that we were able to make some significant performance gains by comparing jQuery against itself: Seeing how many internal function calls were being made and to work to reduce the complexity of the code base.

View the cropped chart.

In jQuery 1.4 we’ve significantly reduced the complexity of the most popular methods in jQuery. The full performance details can be found below.

Easy Setter Functions

For a while now, you’ve been able to pass a function into .attr() and the return value of that function is set into the appropriate attribute. This functionalilty has now been extended into all setter methods: .css(), .attr(), .val(), .html(), .text(), .append(), .prepend(), .before(), .after(), .replaceWith(), .wrap(), .wrapInner(), .offset(), .addClass(), .removeClass(), and .toggleClass().

Addtionally, for the following options, the current value of the item is passed into the function as the second argument: .css(), .attr(), .val(), .html(), .text(), .append(), .prepend(), .offset(), .addClass(), .removeClass(), and .toggleClass().

This enables code like:

// find all ampersands in A's and wrap with a span
$('a').html(function(i,html){
  return html.replace(/&amp;/gi,'<span class="amp">&amp;</span>');
});
 
// Add some information to the title of the anchors
$('a[target]').attr("title", function(i,title){
  return title + " (Opens in External Window)";
});

Ajax

Nested param serialization (jQuery.param() Documentation, Commit 1, Commit 2)

jQuery 1.4 adds support for nested param serialization in jQuery.param, using the approach popularized by PHP, and supported by Ruby on Rails. For instance, {foo: ["bar", "baz"]} will be serialized as “foo[]=bar&foo[]=baz”.

In jQuery 1.3, {foo: ["bar", "baz"]} was serialized as “foo=bar&foo=baz”. However, there was no way to encode a single-element Array using this approach. If you need the old behavior, you can turn it back on by setting the traditional Ajax setting (globally via jQuery.ajaxSettings.traditional or on a case-by-case basis via the traditional flag).

There are three ways to enable the traditional way of serialization:

// Enables for all serialization
jQuery.ajaxSettings.traditional = true;
 
// Enables for a single serialization
jQuery.param( stuff, true );
 
// Enables for a single Ajax requeset
$.ajax({ data: stuff, traditional: true });

More information: jQuery.param() Documentation, jQuery.ajax() Documentation, Commit, Code

JSON and script types auto-detected by content-type (jQuery.ajax Documentation, Commit 1, Commit 2)

If the response to an Ajax request is returned with a JSON mime type (application/json), the dataType defaults to “json” (if no dataType is specified). Additionally, if the response to an Ajax request is returned with a JavaScript mime type (text/javascript or application/x-javascript) , the dataType defaults to “script” (if no dataType is specified), causing the script to automatically execute.

Etag support has been added (jQuery.ajax() Documentation, Commit)

By default, jQuery ignores the Last-Modified header for Ajax requests, preferring to make request and ignore the browser cache. Specifying ifModified: true causes jQuery to use the browser cache if available. jQuery 1.4 will also send the If-None-Match header (for ETag support) if you specify ifModified.

Strict JSON parsing, using native JSON.parse (jQuery.ajax() Documentation, Commit 1, Commit 2, Commit 3)

jQuery 1.3 and earlier used JavaScript’s eval to evaluate incoming JSON. jQuery 1.4 uses the native JSON parser if available. It also validates incoming JSON for validity, so malformed JSON (for instance {foo: "bar"}) will be rejected by jQuery in jQuery.getJSON and when specifying “json” as the dataType of an Ajax request.

Serialize HTML5 elements (jQuery.param() Documentation, Commit)

The new HTML5 input types (such as `datetime` and `range`) will be included when you .serialize() a form.

Context for Ajax Request (jQuery.ajax() Documentation, Commit)

You can now specify a context for an Ajax request, and all callbacks will have that context set (allowing you to simplify your code and possibly avoid having to use closures, or use other objects).

jQuery.ajax({
    url: "test.html",
    context: document.body,
    success: function(){
        jQuery(this).addClass("done");
    }
});

Success callback receives XHR object as third argument (jQuery.ajax() Documentation, Commit)

The success callback for any ajax request now receives the XMLHttpRequest object as the third argument. Previously this XHR object was only accessible as the return value for $.ajax and the like.

Explicitly set a content-type (jQuery.ajax() Documentation, Commit)

In jQuery 1.3, the contentType setting was ignored in jQuery.ajax if no data was sent. In jQuery 1.4, the contentType is always sent. This fixes an issue with some backends that used the Content-Type header to decide what kind of response to send.

Explicitly specify a JSONP callback name (jQuery.ajax Documentation, Commit)

You can now specify the name of the JSONP callback in jQuery.ajax() using the jsonpCallback option.

Avoid pre-flighting cross-domain XHR (Commit)

Cross-domain ajax (for the browsers that support it) is smoother with jQuery as preflighting is avoided by default.

jQuery.ajax() is now using onreadystatechange instead of a timer (Commit)

Ajax requests should now take fewer resources by using onreadystatechange instead of polling.

Attributes

The performance of .css() and .attr() has been improved.

The .attr() takes a function setter (.attr() Documentation)

Not only can you use a function with .attr(), but you can also use the current value of the attribute with the function.

jQuery('<img src="enter.png" alt="enter your name" />')
    .attr("alt", function(index, value) {
        return "Please, " + value;
    });

.val( Function ) (.val() Documentation)

<input class="food" type="text" />
<input class="food" type="text" />
jQuery("input:text.food").hide();
 
jQuery("<ul class='sortable'><li>Peanut Butter</li><li>Jelly</li></ul>")
  .sortable()
  .bind("endsort", function() {
    $(":text.food").val(function() {
      return $("ul.sortable li:eq(" + $(this).attr("data-index")  + ")").text();
    });
  });</li>

.text() works on text and CDATA nodes (.text() Documentation, Commit)

Core

Quick Element Construction (jQuery() Documentation, Commit)

When you create a single element with the jQuery function, you can now pass in an object to add attributes and events at the same time:

jQuery("<div>", {
    id: "foo",
    css: {
        height: "50px",
        width: "50px",
        color: "blue",
        backgroundColor: "#ccc"
    },
    click: function() {
       $(this).css("backgroundColor", "red");
    }
}).appendTo("body");

The keys of the object are functions that will be called with each value passed as an argument.

.eq(-N), .get(-N) (.eq() Documentation, .get() Documentation, Commit)

You can now pass in negative numbers for .get() and .eq(). For example, you can select the second-to-last div or, you can access the DOM element for the same:

$("div").eq(-2);
$("div").get(-2);

New .first() and .last() methods (.first() Documentation, .last() Documentation, Commit)

For convenience, .first() and .last() are aliases of .eq(0) and .eq(-1).

New .toArray() method (.toArray() Documentation, Commit)

.get() has historically returned an Array from the jQuery set. For further clarity, you can use .toArray() to achieve the same thing in jQuery 1.4. Unlike, .get(), however, .toArray() does not take an argument.

jQuery() returns empty set (jQuery() Documentation, Commit)

In jQuery 1.3, jQuery() returned a jQuery set containing just the document. in jQuery 1.4, it returns an empty jQuery set. This can be useful for creating an empty set and adding elements to it dynamically. Note: The jQuery().ready() technique still works in 1.4 but it has been deprecated. Please use either jQuery(document).ready() or jQuery(function(){}).

jQuery(“TAG”) (Element Selector Documentation, Commit)

A faster path is used when passing in a single tag name.

jQuery(“<div>”) jQuery(“<div/>”) and jQuery(“<div></div>”) (jQuery() Documentation, Commit)

All three now use the same code path (using document.createElement), improving performance for jQuery("<div></div>"). Note that if you specify attributes, we use the browser’s native parsing (using innerHTML).

CSS

The performance of the .css() method has seen a 2x performance improvement.

The performance of the .addClass(), .removeClass(), and .hasClass() methods has seen a 3x performance improvement.

.toggleClass() can toggle multiple classes (.toggleClass() Documentation, Commit)

You can now call .toggleClass() with multiple selectors and they will all be toggled.

$("div").toggleClass("current active");

Big News: jQuery 1.4 has been released! Head on over to the 14 Days of jQuery site to see the full details:

jQuery 1.4 Released

Also Media Temple has just started their 15 prizes for 14 days of jQuery contest. Submit cool uses of jQuery and enter to win free hosting or even a laptop!

Originally published at 14 Days of jQuery (archived).

14 Days of jQuery and the New API Browser

Posted on by

It’s the start of a new year, and the jQuery team’s been hard at work. We’ve been up day and night working to crank out the upcoming jQuery 1.4 release, and there’s a LOT to announce! So much, in fact, that we’ll need fourteen full days to get it all out there… As such, I’d like to announce The 14 Days of jQuery 1.4!

The New jQuery 1.4 Site

Beginning on January 14th, we’ll start a fourteen-day event. Each day we’ll have fresh videos and announcements — there’ll be code releases, project-related updates, and jQuery UI goodness, among other things. In addition to the announcements, we’ll also be releasing a set of videos over the 14 days with talks and tutorials relating the jQuery 1.4 release and other general jQuery topics. You’ll want to check back at jQuery14.com every day during the two weeks to see what’s new, or sign up to be notified via email. Think of it like an online conference, only longer, freer, and with a bit of mystery and suspense!

But Wait, There’s More!

We’ve got a lot planned for January 14th, but it seemed good to whet your appetite and pre-release some tasty jQuery morsels. Head over to jQuery14.com to learn all about the brand-new jQuery API site:

Be sure to subscribe to the jQuery14.com site or to the @jquery Twitter account for all the updates during these upcoming weeks.

Free Books, Anyone?

The jQuery project is a non-profit, open-source effort, and we rely heavily on donations and contributions to help fund everything we do. We’ll be running a fundraising drive starting now and throughout the 14 Days of jQuery. If you’re a jQuery user, show your support by making a tax-deductible donation of $20 USD or more to the project during the event, and you’ll receive a free jQuery book with your donation.

It’s always important to mention that much of this would not be possible without the help of the jQuery project sponsors; Netflix, JupiterIT Consulting, appendTo, Fusionary Media and Oxide Design Co have all signed on as official sponsors of the 14 Days of jQuery 1.4, along with our favorite jQuery book publishers, Manning, Packt, jQuery Enlightenment, and O’Reilly.

That’s it for now — head on over to jQuery14.com for much more to come!