Archive for January, 2007

Copy Events from One Element to Another

Need to clone an element and its events? Sure, you could rebind the events after doing the clone, but that wouldn’t be very DRY now, would it? Introducing Copy Events, a new plugin for jQuery.

Read the rest of this entry »

Effect Delay Trick

Here is a quick trick for getting an effect to delay without using setTimeout.

Let’s say, for example, that I want to show an alert message on the page every time a user clicks on a certain button. But I don’t want it to stay there forever; I want it to go away a few seconds later. You know, like the way they do in all of those crazy Web 2.0 sites.

Read the rest of this entry »

jQuery 1.1 Released!

It’s jQuery’s first birthday, and John Resig and the development team are celebrating in style with a brand new release of jQuery!

Version 1.1 has just about every performance and feature improvement that I mentioned in my previous Year of jQuery entry — the huge speed improvements, the streamlined API, and even the much-improved documentation and website (kudos to the web and design teams!). Don’t wait another second. Abandon this blog right now and go directly to jquery.com for all of the new goodies!

Are you still here? Oh well. Then bear with me another minute while I write a bit more about the streamlined API. The new jQuery has much more speed and functionality for just a couple more kb of code. One way that was achieved was by stripping out some of the excess helper methods that appeared to be little used or redundant. If you are running jQuery on a production site, please be careful about upgrading. A good way to start is to drop in the jQuery 1.0 to 1.1 compatibility plugin (JS file), and then read through the list of API changes that John Resig outlined in a recent blog entry.

Here on Learning jQuery, we (okay, I) will be going through the old entries in the next few days, providing updated code and instructions for 1.1 in places where there might be a compatibility issue. So, keep an eye out for the jQ1.1 icon:

Now, really, you must stop reading this post and go get yourself some of that jQuery 1.1!

The Year of jQuery

I hereby decree that 2007 shall be the Year of jQuery. Well, what else would you expect from a blog about jQuery? But, really, this is not just another case of wishful thinking, or even one of those lame prediction posts that have been spinning around the web lately. Admittedly, the title might suffer from a touch of hyperbole. But just a touch.

Here are a few of the reasons why I think jQuery is going to explode in 2007:

  1. Massive Speed Improvements coming our way. Remember that entry I just wrote about optimizing DOM traversal? Well, pretty soon you won’t have to worry so much about that. I’ve run the speed tests (created by Yehuda Katz of Visual jQuery fame), and I’ve been blown away by the results. You will be, too.
  2. Streamlined API is nigh. While the temptation is always great for fattening up software, cramming every bell and whistle and double-cheeseburger into it, John Resig and the gang have been busily trimming jQuery, sculpting it into a lean, mean JavaScript machine. And we’ll all get more for less — more performance, more power, more sense.
  3. The plugins keep rolling in: If you haven’t checked out the growing list of plugins lately, you’re in for a treat. Also, Jörn Zaefferer, developer extraordinaire, has been on a tear lately with plugin blog entries, including a jQuery Plugin Authoring Guide, and a “plugin parade,” in which he explains how and why to use some already-made plugins.
  4. A slicker, more usable, better organized jquery.com: A group of dedicated web designers are working hard to update jQuery’s online headquarters so that visitors can find what they need quickly and know where to go for additional support.
  5. High-profile adoption: The good folks at Drupal recently announced that they plan to include jQuery in the core of their next major CMS release (5.0). Many more are sure to follow. And when other open-source communities get hooked on jQuery, the smart members of those communities inevitably contribute to the overall project. We’ve also seen some influential sites such as Technorati, Feedster, and Intuit.com put jQuery to good use, a trend that is sure to continue. What’s more, server-side technologies such as ColdFusion are embracing jQuery for its AJAX goodness.
  6. The best open-source community in the universe. I have been wowed repeatedly by how smart, thoughtful, eager, and dedicated the people who have been working on jQuery are. The many questions that come through the mailing list each day — from the mundane to the arcane — are answered promptly and respectfully. Furthermore, John Resig recently organized the project into teams to make the processes of improving jQuery, redesigning the site, and spreading the word go more smoothly and efficiently (full disclosure: John invited me to join jQuery’s “evangelism” team. Big surprise, huh? Maybe I need to start eating locusts and wild honey now.)

The coolest thing about this news is that we’ll be seeing most, if not all, of the improvements I’ve mentioned within the next couple months — some perhaps within weeks. jQuery has its first birthday coming on the 14th of this month, and it’s sure to bring some nice birthday presents for all. So, stay tuned!