Monday, February 23rd, 2009

jQuery 1.3.2 and beyond

Category: jQuery

jQuery 1.3.2 has been released and although it is mainly a bug fix maintenance release, it does a little more, including:

  • Elements Returned in Document Order
  • .live() Can Now Prevent Bubbling
  • :visible/:hidden Overhauled
  • .height()/.width() Overhauled
  • Selector Speed-up in IE
  • .appendTo()/etc. Now Return Inserted Elements

It is also fun to look at the grab back of possible features on the table for 1.4 and beyond. Here are just a few:

  • jQuery.require (require JavaScript modules and CSS to load before ready runs)
  • Dynamic loading of modules when they’re needed (would require synchronous script loading in core)
  • $.contains (determine if an element is inside another one)
  • Handle HTML injection in XML documents (serialize a DOM then insert)
  • Implement a .extract()/.detach() method (remove the element from the DOM, leaves events and data intact)
  • Use querySelectorAll for element-rooted queries
  • Piggy-back on a central data cache, if one exists.
  • Allowing a function as the “setter” argument for .css() — like we have in .attr() — and maybe for .val(), .html(), and .text() as well.
  • Offset: Faster Initialization, use parseFloat, boundingClientRect check
  • Events: Have img.load check for .complete in IE, Multiple binding with namespaces, Event scoping, .live() improvements
  • Ajax: Use JSON API if available to parse JSON, Dynamic loading of stylesheets
  • Effects: Synchronized animations, fadeTo show also show the element, if it’s hidden

Posted by Dion Almaer at 7:01 am

2.7 rating from 123 votes


Comments feed TrackBack URI

I wonder when .live() will handle onSubmit bubbling.

Comment by Aimos — February 23, 2009

@Aimos: As mentioned in the release notes, that’s coming in 1.3.3.

Comment by JohnResig — February 23, 2009

Roadmap is looking good. Some of it gives me the impression jquery is growing into something more like Dojo. Not that that’s a bad thing but stuff like .require might be better fit for a plugin.

Comment by Jadet — February 23, 2009

Yes, keep the core library as small as possible! Speed is the critical thing here.

There is already a “require” plugin that works quite well.

Regardless, thank you, John, and the jQuery team for an excellent library.

Comment by m3tropolis — February 23, 2009

What I’d like to see the most are special versions for iPhone and AIR. Especially for iPhone, it’s silly to have baggage for all the other browsers.

There are some new js libraries addressing the iPhone because of the current code bloat in JS libraries that is due to handling so many browsers, but I’d rather have a stripped jQuery.

Comment by Nosredna — February 23, 2009

First of all, I am very glad that jQuery is interested in “lazy loading” of javascript/css. (I wrote the xLazyLoader ).

But I also think, that it doesn’t belong in the core of jQuery, but rather in the UI.
1. Keep the core small
2. The majority of users don’t need to “lazy load” the plugins

Some new features:
I would predefine the standard paths to the files for ui and effects, as well as interface for ui.progress.js.
There is also no posiibility to register the plugins, so that they can be later loaded, as they needed.

jQuery.register('pluginName', 'ui.plugin.js', 'ui.plugin.css')


files: 'ui.plugin.js', 'ui.plugin.css',
name: pluginName,
type: 'lazy'

I would donate and integrate this plugin to jQuery UI and maintain it in the future :)

Comment by Kof — February 23, 2009

@Aimos in JavaScriptMVC right now.

Comment by JustinMeyer — February 24, 2009

Well the delegate plugin for jQuery also bubbles very well, but I was asking for the jQuery core one. :D

Comment by Aimos — February 24, 2009

@Jadet I guess each will differ about what should be core and plugin but the great thing about a requires is that makes handling plugins and script loading easier?

@Kof Thanks for writing XLazyLoader. I’m really looking forward to using this and happy it’s going into jQuery

Comment by heyyeah — February 26, 2009

Leave a comment

You must be logged in to post a comment.