Skip to content

Instantly share code, notes, and snippets.

@sivagao
Created July 19, 2013 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sivagao/6037113 to your computer and use it in GitHub Desktop.
Save sivagao/6037113 to your computer and use it in GitHub Desktop.
jQuery changes log since version 1.4

http://blog.jquery.com/2011/01/31/jquery-15-released/ ajax rewrite: a call to jQuery.ajax (or jQuery.get, jQuery.post, etc.) now returns a jqXHR object that provides consistency to the XMLHttpRequest object across platforms much more extensible – allowing you to attach all sort of data handlers, filters, and transports.

deferred objects: to work with return values that may not be immediately present (such as the return result from an asynchronous Ajax request). Additionally it gives you the ability to attach multiple event handlers

jQuery.sub(): a new way in which you can create and modify a clone of jQuery – all while still taking advantage of the full jQuery API. For example, you could use it to override native jQuery methods without actually affecting the methods that other users would interact with Adjacent Traversal Performance: e.g.: commonly-used traversal methods: .children(), .prev(), and .next().

http://blog.jquery.com/2011/05/03/jquery-16-released/ breaking changes: 1 case-mapping of data-attributes jQuery 1.5 introduced a feature in the .data() method to automatically import any data-dattributes
\ that were set on the element 1.6, with regards to camel-casing data attributes that have embedded dashes.
\ data-max-value="15" would create a data object of { max-value: 15 }[@1.5 version]
\ but as of jQuery 1.6 it sets { maxValue: 15 }

2 .prop(), .removeProp(), and .attr(): .prop() method sets or gets properties on DOM elements, and .removeProp() removes properties.

Attributes: to add in special handling for specific attributes (jQuery.attrHooks) or form input values (jQuery.valHooks).

  • jquery built-in css hooks jQuery.attrHooks.selected = { set: function( elem, value ) { if ( value === false ) { jQuery.removeAttr(elem, “selected”); return value; } } };

CSS: relative css: ported the functionality from the .animate() method,
\ giving you the ability to update CSS properties using relative values.
\ $("#item").css("left", "+=10px");

Data: achieved by improving the performance of event triggering. jQuery’s .data() method triggers getData and setData events, improving how they’re triggered allows .data() to become even faster.

Deferred: deferred.always() deferred.pipe()

function chainedAjax( url ) { return $.Deferred(function( defer ) { $.ajax( url ).then( function( url2 ) { $.ajax( url2 ).then( defer.resolve, defer.reject ) }, defer.reject ).promise(); }); }

Effects: synced animations: you can have multiple animations running simultaneously smoother animations: jQuery is now using the new requestAnimationFrame method provided by browsers to make our animations even smoother. .promise: Just like $.ajax() before it, $.animate() gets “deferred”. j

Events: performance improvements jQuery.holdReady() - a mechanism for delaying the execution of the ready event Selector: :focus - use this selector to find the currently focused element on the page (such as a form input). $("input:focus").addClass("active"); Traversing: find(), closest(), and is() now all take DOM elements and jQuery objects

http://blog.jquery.com/2011/11/03/jquery-1-7-released/ AMD: asynchronous Module definition jQuery now supports the AMD API. it cooperates with AMD-compliant loaders such as RequireJS or curl.js so it can be loaded dynamically and the ready event can be controlled by the loader.

jQuery.Deferred The jQuery.Deferred object has been extended with new progress handlers and notification methods that call those handlers. This allows you to asynchronously notify listeners of progress in a request without resolving or rejecting the request. In addition, there is a new state() method that returns the current state of the Deferred; it’s primarily useful for debugging. Deferreds are now implemented using a new jQuery.Callbacks feature, a generalized way of queueing and triggering a series of handlers.

HTML5 SHIV: With jQuery 1.7 we built in support for using HTML5 tags in older IEs with methods like .html(). You must still include html5shiv (or Modernizr) in the head of your document in older IEs for HTML5 tag support.

Improved Performance on Delegated Events: Application frameworks such as Backbone, JavaScriptMVC, and Sproutcore make heavy use of event delegation. By parsing those simple selectors in JavaScript at the time the event was attached, we were able to outperform even the browser’s native-code implementations of matchesSelector during event delivery. For more complex selectors we still use the Sizzle engine, so all existing code should continue to work.

New Event APIs: .on() and .off(): $(elements).on( events [, selector] [, data] , handler ); $('.comment').delegate('a.add', 'click', addNew); $('.comment').on('click', 'a.add', addNew); $('a').live('click', fn); $(document).on('click', 'a', fn); $('.dialog').undelegate('a', 'click.myDlg'); $('.dialog').off('click.myDlg', 'a');

http://blog.jquery.com/2012/08/09/jquery-1-8-released/ A whirlwhind tour of jQuery1.8

Sizzle re-architected: Sizzle smoothes that road for you. Plus, you may want those useful jQuery selector extensions like :has() with a complex selector or :contains(). Oh yeah, and there’s still IE6/7 support. Animations re-imagined: Automatic CSS prefixing: More flexibility with $(html, props): More than 160 bugs closed: Smaller code size: Modularity:

What’s Been Removed $(element).data(“events”): for debugging purposes via $._data(element, "events") Deferred.isResolved() and Deferred.isRejected() $.curCSS: $.attrFn:

On January 14, 2006, John Resig attended BarCampNYC and made a presentation about his new project called jQuery. In a contemporary blog post John said, “This code revolutionizes the way you can get JavaScript to interact with HTML.” It was a bold statement, but in retrospect we know it was an understatement.

jQuery projects moved from under the wing of the Software Freedom Conservancy to our own non-profit organization: The jQuery Foundation.

To serve the evolving needs of web developers, jQuery has grown far beyond the core library. jQuery UI provides a rich set of user interface widgets that share a consistent and common set of events, programming conventions, and visual styles. jQuery Mobile offers a framework designed to simplify web site and HTML app development on mobile devices.

Additional jQuery Foundation projects such as Sizzle, QUnit, and TestSwarm provide valuable components and tools for web development.

jQuery 1.9 final: This latest version of jQuery core provides support for a full spectrum of browsers, from IE6 all the way to the most recent releases of every major browser.

jQuery 2.0 beta: Here is your taste of the future, a jQuery that can be faster and smaller without the need to support IE 6, 7, or 8. It’s a great choice for platform-specific HTML applications.

jQuery Migrate 1.0 final: Use this plugin to find things that may cause upgrade issues when you move up from older jQuery versions, and to allow older code to work with either jQuery 1.9 or 2.0.

jQuery UI 1.10 final: This version of jQuery UI includes API redesigns for both the Dialog and Progressbar components, in addition to a healthy set of fixes to other components.

New and remodeled web sites: All jQuery sites are being updated with a new look, and we’re encouraging contributions via Github. The most exciting news of all? The Plugin site returns!

To exactly match $("a.foo").live("click", fn), for example, you can write $(document).on("click", "a.foo", fn). To exactly match $("a.foo").die("click"), for example, you can write $(document).off("click", "a.foo").

Prior to 1.9, .data("events") could be used to retrieve jQuery's undocumented internal event data structure for an element

jQuery.proxy() context New in 1.9, the function returned by calling jQuery.proxy with a falsy context will preserve its this object for the provided function. Previously, a falsy value for context would get translated into the global object (window) if null/undefined, or else wrapped in an object (e.g., new Boolean(false)). As of 1.9, the event name string "hover" is no longer supported as a synonym for "mouseenter mouseleave". This allows applications to attach and trigger a custom "hover" event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment