Over a million developers have joined DZone.

Happy Birthday jQuery! 1.4 Released

· Web Dev Zone

Make the transition to Node.js if you are a Java, PHP, Rails or .NET developer with these resources to help jumpstart your Node.js knowledge plus pick up some development tips.  Brought to you in partnership with IBM.

On its 4 year anniversary, jQuery is announcing the final release of jQuery 1.4.  The new, lightweight JavaScript library sports some major speed improvements, new functionality, and better overall codeflow.  Starting today, the whole jQuery team will be at AOL hosting 14 Days of jQuery, an online event explaining the features of 1.4.

The new version of jQuery features better iframe support, flexible events, and much more.  For improving performance, the jQuery team used the FireUnit test suite add-on for Mozilla's Firebug.  By looking at the function call stats, the team was able to reduce the code complexity of their framework and make what was already elegant code even more lightweight.  1.4 also includes workarounds for events that don't bubble in Internet Explorer.  Another new feature is the  jQuery.require() script loader, which allows pieces of code to be loaded asynchronously without harming applications.

The API for jQuery has gotten a complete rewrite by Karl Swedberg.  One of the biggest changes is in .live(), which now supports custom events as well as all JavaScript events.  There is already a cheatsheet available for the jQuery 1.4 API.  Here are the newest additions to the 1.4 API:

  • jQuery.contains() - Check to see if a DOM node is within another DOM node.
  • 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").
  • 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.
  • .nextUntil() - Get all following siblings of each element up to but not including the element matched by the selector.
  • .clearQueue() - Remove from the queue all items that have not yet been run.
  • .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() - Check to see if a DOM node, or selector set of DOM elements, is within another DOM node.
  • .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.

jQuery is giving away free ebooks to anyone who makes a donation of $20 or more to the open source jQuery project.  Go to the donations page and make a tax-deductible contribution.

Keep an eye out for more feature announcements on the 14 Days of jQuery website.  Here is the source code for the jQuery 1.4 final.  Enjoy!

Learn why developers are gravitating towards Node and its ability to retain and leverage the skills of JavaScript developers and the ability to deliver projects faster than other languages can.  Brought to you in partnership with IBM.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}