jQuery 1.2 Released!

This is a major release for the JavaScript library that I have grown to love. Before I list the new features, it is important to note what functionality has been removed from jQuery.

Here’s the deprecated functionality:

  • These Selectors
    • XPath Descendant Selector: $(“div//p”)
    • XPath Child Selector: $(“div/p”)
    • XPath Parent Selector: $(“p/../div”)
    • XPath Contains Predicate Selector: $(“div[p]“)
    • XPath Attribute Selector: $(“a[@href]“)
  • Calling clone() with an argument: $(“div”).clone(false);
  • These Traversal Functions use the new .slice() instead):
    • $(“div”).eq(0);
    • $(“div”).lt(2);
    • $(“div”).gt(2);
  • These Ajax Functions:
    • $(“#elem”).loadIfModified(“some.php”);
    • $.getIfModified(“some.php”);
    • $.ajaxTimeout(3000);
    • $(…).evalScripts();

Thankfully a number of those don’t effect me. I’ll have to comb through my code to get rid of the .gt, .lt, and .eq traversal functions as well as a few of the selectors…but other than that, I’m good to go. To find out more about workarounds for the above removed functionality, check the jQuery 1.2 release notes

Now…on to the good stuff.

New features!

  • Selectors

    •  :has(selector)
    •  :header
    •  :animated
    • XPath Selector Plugin
  • Attributes
    • .val() Overhaul
  • Traversing
    • .map()
    • .prevAll() / .nextAll()
    • .slice()
    • .hasClass()
    • .andSelf()
    • .contents()
  • Manipulation
    • .wrapInner() / .wrapAll()
    • .replaceWith() / .replaceAll()
    • Event Cloning
  • CSS
    • .offset()
    • .height() / .width() for document and window
  • Ajax
    • Partial .load()
    • Cross-Domain getScript
    • JSONP
    • .serialize() Overhaul
    • Disable Caching
  • Effects
    • .stop()
    • %/em Animations
    • Color Animations
    • Relative Animations
    • Queue Control
    •  :animated
    • step: Function
  • Events
    • Namespaced Events
    • .triggerHandler()
  • Internals
    • Documentation Move
    • Expando Management

I have to say…it is a pretty snazzy release and I’ll begin implementing the new version shortly. w00t.

jQuery 1.1a Released

The jQuery 1.1a has been released today by the jQuery team! Its important to note that this is an alpha version before you go out and install it in a production environment, but the jQuery team asks that people give it a round of testing prior to the release this weekend.

The “Quick and Dirty” on v1.1:

  • Its selectors are 10-20x faster than those in jQuery 1.0.4.
  • The documentation has been completely revamped.
  • The complexity of the API has dropped by 47%.
  • It has a ton of bug fixes.
  • It has a bunch of great new features.
  • … and it’s still the small 19KB that you’ve come to expect.

With this release come a lot of API changes:

Firstly, :nth-child() now starts at 1, instead of 0.

A number of methods have been re-organized/re-named. Here’s the translation of old to new functions:

Old Way (1.0.x) New Way (1.1)
.ancestors() .parents()
.width() .css(”width”)
.height() .css(”height”)
.top() .css(”top”)
.left() .css(”left”)
.position() .css(”position”)
.float() .css(”float”)
.overflow() .css(”overflow”)
.color() .css(”color”)
.background() .css(”background”)
.id() .attr(”id”)
.title() .attr(”title”)
.name() .attr(”name”)
.href() .attr(”href”)
.src() .attr(”src”)
.rel() .attr(”rel”)
.oneblur(fn) .one(”blur”,fn)
.onefocus(fn) .one(”focus”,fn)
.oneload(fn) .one(”load”,fn)
.oneresize(fn) .one(”resize”,fn)
.onescroll(fn) .one(”scroll”,fn)
.oneunload(fn) .one(”unload”,fn)
.oneclick(fn) .one(”click”,fn)
.onedblclick(fn) .one(”dblclick”,fn)
.onemousedown(fn) .one(”mousedown”,fn)
.onemouseup(fn) .one(”mouseup”,fn)
.onemousemove(fn) .one(”mousemove”,fn)
.onemouseover(fn) .one(”mouseover”,fn)
.onemouseout(fn) .one(”mouseout”,fn)
.onechange(fn) .one(”change”,fn)
.onereset(fn) .one(”reset”,fn)
.oneselect(fn) .one(”select”,fn)
.onesubmit(fn) .one(”submit”,fn)
.onekeydown(fn) .one(”keydown”,fn)
.onekeypress(fn) .one(”keypress”,fn)
.onekeyup(fn) .one(”keyup”,fn)
.oneerror(fn) .one(”error”,fn)
.unblur(fn) .unbind(”blur”,fn)
.unfocus(fn) .unbind(”focus”,fn)
.unload(fn) .unbind(”load”,fn)
.unresize(fn) .unbind(”resize”,fn)
.unscroll(fn) .unbind(”scroll”,fn)
.ununload(fn) .unbind(”unload”,fn)
.unclick(fn) .unbind(”click”,fn)
.undblclick(fn) .unbind(”dblclick”,fn)
.unmousedown(fn) .unbind(”mousedown”,fn)
.unmouseup(fn) .unbind(”mouseup”,fn)
.unmousemove(fn) .unbind(”mousemove”,fn)
.unmouseover(fn) .unbind(”mouseover”,fn)
.unmouseout(fn) .unbind(”mouseout”,fn)
.unchange(fn) .unbind(”change”,fn)
.unreset(fn) .unbind(”reset”,fn)
.unselect(fn) .unbind(”select”,fn)
.unsubmit(fn) .unbind(”submit”,fn)
.unkeydown(fn) .unbind(”keydown”,fn)
.unkeypress(fn) .unbind(”keypress”,fn)
.unkeyup(fn) .unbind(”keyup”,fn)
.unerror(fn) .unbind(”error”,fn)

What’s more? Well, the jQuery team will be posting throughout the week on all the cool new things you can do with jQuery 1.1. I’m looking forward to seeing the changes! Oh, with regards to changes, its important to note with that list of functions above…the old method will no longer work come v1.1. To keep those functions in use, a ‘helper’ library will need to be used…chances are that won’t be available until the 1.1 final.