I'm really happy with these recent upgrades. Especially in regards to event delegation, not having an effective baked in solution for event delegation was one of my biggest complaints about the previous releases.
Yum, I'm glad .live() is in the core.
How different is .live() from .bind()? does this mean we do not have to .unbind() and .bind() when we want to create events for dynamically created DOM elements?
Would you consider adding something like .live() for CSS? (Or maybe it already does that.)
Unfortunately it's not as simple as it is with events. With events you have the advantage of binding to a single point (e.g. the document node) and using the native event bubbling that exists in all browsers to capture any event that occurs on the page. This way we can detect a click on a new DOM element that we haven't seen before.
We don't have that luxury with CSS. There's no universal way for all browsers to let JavaScript know when a new element has been added to the page - or that it's been moved. There's the W3C DOM mutation events but they aren't implemented everywhere.
More info: http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-e...
What? I thought you could just edit the stylesheet object.
Thanks for your quick response.
Well, we could certainly inject new stylesheet rules but that's bound to cause problems since we're at the mercy of the browser CSS engines. I suspect that most jQuery users enjoy writing selectors like "div:first > span" which will be completely null-and-void once we step out of our protected JavaScript garden. Since we can't get full API compatibility it really makes the prospect not very exciting for us.
New Selector Engine (Sizzle: http://github.com/jeresig/sizzle/tree/master). Much faster than previous engine, going to be in many of the major libraries.
No more browser sniffing (currently being discussed here: http://www.reddit.com/r/programming/comments/7l2mr/jquery_re...).
.closest() method - extremely useful for event delegation.
.live() - Super-simple event delegation. .offset() rewrite - significantly faster, uses no browser sniffing..hide()/.show() rewrite - 50% - 200% faster.
.append/prepend/before/after rewrite - 10-15x faster.
While the biggest feature of this release is performance, the new event delegation methods are going to be super-useful.
As to jQuery UI - there are multiple teams within the jQuery project - the core jQuery team works on the jQuery library and the jQuery UI team works on jQuery UI. In their last update (about a week ago) the UI team said that UI 1.6 final was going to be out before the end of the month.