New Features in jQuery 1.4! CodeUnit 19 JAN 2010

Four years have passed since the initial public release of the stellar jQuery library and in celebration the guys over at jQuery have just released jQuery 1.4, the first major core release for 2010. They’re making a pretty big song and dance about the whole thing, packaging everything nicely up in a special blog entitled The 14 Days of jQuery.

Moving on to this new version of the popular jQuery library, we see it now comes packaged with quite a few new options, particularly when it comes to the selector functionality of the library. However, this isn’t the only section to feature some newbies and as such I’ve pulled out a list of the new function additions to the library (ignoring existing functionality updates), functions I guess we’ll all become pretty familiar with as we now begin to grapple with this latest beast! ;)

  • .clearQueue(): Remove from the queue all items that have not yet been run.
  • jQuery.contains(): Check to see if a DOM node is within another DOM node.
  • .delay(): Set a timer to delay execution of subsequent items in the queue.
  • .detach(): Remove the set of matched elements from the DOM.
  • .focusin(): Bind an event handler to the “focusin” JavaScript event.
  • .focusout(): Bind an event handler to the “focusout” JavaScript event.
  • .has(): Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
  • jQuery.isEmptyObject(): Check to see if an object is empty (contains no properties).
  • jQuery.isPlainObject(): Check to see if an object is a plain object (created using “{}” or “new Object”).
  • .nextUntil(): Get all following siblings of each element up to but not including the element matched by the selector.
  • jQuery.noop: An empty function.
  • .parentsUntil(): Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector.
  • .prevUntil(): Get all preceding siblings of each element up to but not including the element matched by the selector.
  • jQuery.proxy(): Takes a function and returns a new one that will always have a particular scope.
  • .toArray(): Retrieve all the DOM elements contained in the jQuery set, as an array.
  • .unwrap(): Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.

There are a couple of great additions in the list above, though I must say my most eagerly anticipated one is definitely the delay function – at last a built in native function that eliminates you having to create your own setTimeout and wait functions – Nice! :)

Related Link: http://api.jquery.com/category/version/1.4/

Related Posts:

About Craig Lotter

Software developer, husband and dad to two little girls. Writer behind An Exploring South African. I don't have time for myself any more.