2016-01-08

To usher in the new year, the jQuery team has been hard at work on 2 new releases: jQuery 1.12.0 and 2.2.0! These releases include lots of bug fixes and improvements to make your cross-browser development experience better. We anticipate this to be the last releases for the 1.x and 2.x branches before we release jQuery 3.0. Since jQuery 3.0 will have some breaking changes, we will continue to support 1.12 and 2.2 after jQuery 3.0 is released, but only with patches for major regressions. As a side-note, we will have some big news related to jQuery 3.0 coming soon!

Performance Improvements

Performance of the selector engine has improved thanks to a shortcut path that immediately uses precompiled Sizzle selectors when the selector cannot be processed by the native querySelectorAll or matchesSelector methods. This results in a significant speedup in some real-world cases.

New Features

We’ve added some minor, non-breaking features that we thought might be useful in these releases. Here are some of the highlights.

SVG Class Manipulation

While jQuery is a HTML library, we agreed that class support for SVG elements could be useful. Users will now be able to call the .addClass(), .removeClass(), .toggleClass(), and .hasClass() methods on SVG. jQuery now changes the class attribute rather than the className property. This also makes the class methods usable in general XML documents. Keep in mind that many other things will not work with SVG, and we still recommend using a library dedicated to SVG if you need anything beyond class manipulation.

jQuery.post(options) and jQuery.get(options)

These ajax shortcuts have a new signature that takes a single object containing options.

Symbol support

We’ve added support for the Symbol type added in ES6/ES2015. Essentially, this means that jQuery objects can be iterated with for-of where supported.

jQuery.htmlPrefilter()

A new hook has been added for filtering HTML that is passed to jQuery DOM manipulation methods like .html(), .append(), and .replaceWith(). The default prefilter translates single tags to XHTML-compatible tags. This method will allow users to bypass certain edge cases, remove scripts, and sanitize input.

jQuery.uniqueSort alias

To make it clear that jQuery.unique() also sorts, we’ve update the name. jQuery.unique will still exist, but jQuery.uniqueSort will become the documented method. This method is still only intended to sort DOM elements in document order; it is not a general sorting method.

——————————————-

We do not expect this release to have any breaking changes, but if you do encounter bugs in upgrading from the previous version, please let us know.

You can include these files directly from the jQuery CDN if you like, or copy them to your own local server. The 1.x branch includes support for IE 6/7/8 and the 2.x branch does not.

https://code.jquery.com/jquery-1.12.0.js

https://code.jquery.com/jquery-2.2.0.js

These updates are already available as the current versions on npm and Bower. Information on all the ways to get jQuery is available at https://jquery.com/download/. Public CDNs receive their copies today, please give them a few days to post the files. If you’re anxious to get a quick start, use the files on our CDN until they have a chance to update.

Many thanks to all of you who participated in this release by testing, reporting bugs, or submitting patches, including Chris Antaki, Connor Atherton, Jason Bedard, Batiste Bieler, Leonardo Braga, Bastian Buchholz, Anne-Gaelle Colom, David Corbacho, Brenard Cubacub, Aurelio De Rosa, Hamish Dickson, Ben Edelman, Stephen Edgar, Esteban, Alexander Farkas, Joelle Fleurantin, flexphperia, Corey Frang, Xue Fuqiao, Oleg Gaidarenko, Richard Gibson, Micha? Go??biowski, Scott González, goob, Christian Grete, Veaceslav Grimalschi, Mu Haibao, Dan Hart, Frederic Hemberger, Sean Henderson, Nicolas Henry, Daniel Herman, Jon Hester, Victor Homyakov, Winston Howes, Daniel Husar, Yongwoo Jeon, Essam Joubori, Taehee Kim, Richard Kraaijenhagen, Veres Lajos, Marek Lewandowski, Reed Loden, George Mauer, Richard McDaniel, Amit Merchant, Calvin Metcalf, Dave Methvin, MightyBranch, Nazar Mokrynskyi, Matthew Mueller, Julian Alexander Murillo, Martin Naumann, Daniel Nill, Alexander O’Mara, Adrian Olek, Randson Oliveira, James Pearce, Gilad Peleg, Bruno Perel, PhistucK, PJ, Senya Pugach, Aditya Raghavan, Liza Ramo, Chris Rebert, Anthony Ryan, Gabriel Schulhof, Mike Sidorov, Nick Stefan, Arthur Stolyar, Zheming Sun, Jun Sun, Timo Tijhof, Ben Toews, Thomas Tortorini, Shivaji Varma, Arthur Verschaeve, Rick Waldron, Bin Xin, Norman Xu, Gary Ye, Imran M Yousuf, and Jörn Zaefferer.

Full changelogs

2.2.0

Ajax

Remove workaround for IE6/7 (e519098)

remove event dependency from the ajax module (4e7f34f)

Fix for request aborted in ajaxSend (#1775, 598ed05)

use anchor tag for parsing urls (#1875, b091fdb)

simplify jQuery.parseXML method (5a0867d)

Fix cross-domain detection test for non-default port (83b038f)

$.post and $.get can now take an options object (#1986, 89ce0af)

simplify one ajax call and add explanatory comment (0ac28ed)

make jQuery#load “type” field explicit (4ef120d)

replace “jqXHR.complete” callback with “always” (97ef1f2)

remove use of jQuery#each second argument (a4715f4)

remove “onunload” event handler (a117dd0)

Remove jsonp callbacks through “jQuery#removeProp” method (#2323, a2ae215)

Account for Android 2.3 not firing window.onerror on script errors (6044fb6)

do not quote “throws” option – use dot notation instead (#2571, c9cf250)

correct indentation (cb087ce)

improve content-type detection (#2584, 239169b)

trigger error callback on native abort (#2079, 76e9a95)

Don’t throw exceptions on binary data response (#2498, 769446c)

code style fixes (8a896df)

Attr

Use typeof check for getAttribute method (075da30)

Attributes

remove unnecessary element null check (55ac56a)

Use the option val hook in select val hook and simplify it (#1902, f6302b0)

fix failing test for new return value (5dc4616)

add SVG class manipulation (#2199, 20aaed3)

revert returning null for non-elements (7632b74)

fix tabIndex on in IE11 (#2647, c752a50)

revert returning null for non-existant attributes (2905961)

removeClass() -> attr(“class”, “”) (5db1e05)

Use simpler boolean check vs a function call (4bf1a09)

return null when attribute does not exist (#2118, aaeed53)

Authors

Update AUTHORS.TXT and .mailmap (03557db)

Build

Update QUnit to latest (1.17.1) (2d5c5d2)

Acknowledge Android 2.3 is not ES5-compatible (#2478, 1c59b30)

space between curly and paren is optional (#2399, 63a577a)

Moved JSHint directives to .jshintrc file (15a609f)

update AUTHORS.txt (8f13997)

Add a comment explaining why the es3 option is needed (669cb16)

Upgrade to commitplease 2.0.0 (5bc1ddc)

Refactor Node smoke tests (9c8a3ec)

update version to 3.0.0-pre (7a607c5)

Fix various typos (dc4b914)

Update jscs and lint files (#2056, 10fdad7)

correct jscs paths (99975c4)

Remove empty define({}) from build output (#1768, 2c1b556)

correct style tests files which could be automatically corrected (e35bdc1)

Update commitplease dev dependency (39b7606)

Update grunt-contrib-jshint (1556c46)

remove bower.json lint target (285cfbf)

fix tests in AMD mode (6051609)

Update grunt-contrib-uglify because of a security issue in uglify (835e921)

Update the license attribute (#2331, 8e92e1e)

update requirejs dependency to 2.1.17 (#2290, a644101)

bower.json: remove moot `version` field (61e21a4)

put back “lint” command to the “dev” list (5adf04a)

Upgrade to grunt-bowercopy 1.0.0 (323e82c)

account for version labels in Sizzle versions (#1939, 78ac753)

update node dependencies (9101704)

Sizzle version labels must start with a dash (d6c97ab)

Don’t assume the browser environment; smoke test on Node w/ jsdom (#1950, 76df9e4)

Remove dates from copyright notice (66e1b6b)

Specify valid components for commit messages (0c9d018)

Fix an email address of a contributor (ab30934)

Remove unused Sizzle test files (8d11310)

Move all external libraries to external directory (c5d9d88)

Don’t install jsdom 3 on Node.js 0.10 & 0.12 by default (#2519, dbb2daa)

use different versions of jsdom for Node and iojs testing (#2266, 5c3101f)

Rearrange grunt/npm tasks into a build/dist/test pattern (bb928bd)

Remove npm from dependencies (b92acf7)

Sanctify the component name status of Wrap (a4133ff)

Drop io.js testing, test on latest Node.js (250a199)

Use double quotes in .travis.yml (06320c8)

Test on Node 5 (cbe5b2b)

Speed up the Travis build (31f4f8e)

Remove a double empty line at the end of .travis.yml (cea94a8)

ignore test dependencies for npm install (35f8e15)

update Sizzle to 1.11.1 and include license (c0b23e2)

update grunt-bowercopy (712e78c)

Add “deprecated” to the Testswarm module list (1144e75)

Update license (4f776e5)

update Sizzle (#2042, #1969, 3a0dd5a)

Move test to appropriate module (fbdbb6f)

update Sizzle to 2.0.0 (bcca4f0)

add mailmap entry (3ec73ef)

drop bower; use npm for front-end deps (#15186, e1949f4)

update front-end dependencies (8356948)

fix broken assertions caused by QUnit update (8b6aeae)

Change the 2.2-stable version to 2.2.0-pre (c56e8b6)

Update native-promise-only (again) (f5aa89a)

update Sizzle to 2.2.1 (#2390, 44f8239)

Update native-promise-only (0065e1f)

remove deprecated JSHint options (34da7d5)

save sinon update for later (#2160, 98c25b7)

update node dependencies barring jscs (8e3a0ce)

update grunt-jscs-checker and pass with the new rules (c869a1e)

update source map options for the new grunt jshint (269a27c)

Fixed issue with base path that contain ‘var’ (#2450, 0c34e68)

Callbacks

bring back size reduction (f0532a2)

No object starts out locked (#1989, 0d829f0)

Disabling a callback should prevent firing (#1790, bc1cb12)

Change broken url to wayback one (31d58c5)

CONTRIBUTING

Condense info and add directions to other resources (#1824, bfd5dab)

Close parenthesis (609adf6)

Core

Align branches: remove an unused variable, add comments (f6de5a9)

use interactive to evaluate dom ready, barring IE9-10 (#2100, dabd5ba)

add support to tag-hyphenated elements (534f130)

Test all factory use cases from intro.js (#2181, ab40725)

add workaround for iOS JIT error in isArrayLike (#2145, 1541664)

CSS:Event: simplification of native method signatures (85577a3)

allow init to accept an alternate rootjQuery for migrate’s sake (#2101, 7a6931d)

remove isArraylike check for nodes (#2238, 436f0ae)

Standardize indexOf comparisons (53aa87f)

Support Symbol wrapper objects in jQuery.type (8a73434)

make isNumeric test work on Symbol (0703fd5)

CSS: disable 2 tests for Opera 12 (13d2de7)

Remove unnecessary parameter to jQuery#constructor (98cee73)

Update tested jsdom, drop obsolete workarounds (#2153, 06f6cd1)

change jQuery.each and jQuery#each signatures (#2090, 2380028)

re-introduce createHTMLDocument in parseHTML; Safari 8 left out (cfe468f)

revert addition of createHTMLDocument. Thanks, Safari 8. (b779831)

Consistently use local reference to access() (2fb719e)

pass empty string to createHTMLDocument to appease IE (31c7d7f)

remove unnecessary support test for createHTMLDocument (5923282)

use document.implemenation.createHTMLDocument in jQuery.parseHTML (58c2460)

Simplify and speed up .each (eeda11c)

simplify “each” stylesheet iteration test (fcb6c4d)

add unit test for isPlainObject(Symbol) (#2645, 9090d98)

Follow the AMD specification for define (892625b)

Make jQuery objects iterable (#1693, bb026fc)

Use window.setTimeout & friends instead of global equivalents (#2177, 219c749)

Don’t expose jQuery.access (#2513, 9adfad1)

Switch from modules to just window.setTimeout etc. (842958e)

Drop strundefined variable (29838b6)

organize prop & attr code to be similar (5153b53)

Adjust comments & tests after dropping Safari 6 support (93bee47)

.each/.map should accept an undefined/null value (#2267, bf48c21)

Add a support comment for Safari 8 (d242753)

Css

Fix the “sanity check” test (995f707)

Remove non-functional unit test for negative margin (4ab7431)

CSS

fix :visible/:hidden selectors for inline element w/ content (#2227, 79bcb29)

save 20 bytes in css/support (45ec73f)

Don’t name the anonymous swap function (0019a46)

Correct misrepresentation of “auto” horizontal margins as 0 (#2237, 487d5ca)

Use pre-defined displays for html and body (a772418)

Support relative adjustment in any applicable unit (#1711, 9b03f6d)

use isFinite in place of redundant isNumeric (3689963)

Clean up memory leak in reliableMarginRight (#1795, 7d15b4d)

Correct typo in the comment (7e09619)

elements are hidden when either offsetWidth or offsetHeight is zero (#10406, #13132, 10399dd)

Add animation-iteration-count to cssNumber, fix tests (#2792, b9a6958)

Don’t cache unrecognized CSS property names (#2015, d471842)

Collapse a double if statement into one (7855a1a)

Add unit tests for negative margins and positioning (1b932bb)

Work around an IE11 fullscreen dimensions bug (#1764, 90d828b)

Restore the hack to get pixels for .css(‘width’) etc. (3747cc6)

make the getStyles function more readable (3a0d582)

Fix the pixelMarginRight support test in Android 2.3 (cdfc2d0)

Don’t expose jQuery.swap (#2058, bb4d888)

simplify “defaultDisplay” module (c62486f)

Improve a comment explaining IE11 fullscreen bug (8e4aac8)

Add an integration test for issue gh-1764 (8887106)

Removed redundant “to the number” in comment (895ea68)

Remove use of getDefaultComputedStyle (#15227, 274feb5)

Data

move element cache to element[expando] (#1734, d702b76)

updates to element[expando] cache (222ac3a)

shave off a couple of bytes (6f65f5f)

restore explicit data removal of private data in cleanData. (#2127, 332fd94)

remove user data in cleanData (#2503, 5fe76c6)

avoid Object.defineProperties for nodes (#1728, 95fb798)

speed up $.fn.data() for camel-cased key (#1941, 72c4a06)

find hyphenated data with camelCased key (#2779, c1511c6)

avoid non-alphanumeric chars in expando properties (0cdec79)

Drop the tests relying on applets (#1938, 95c0a10)

Combine register and cache methods (b5f7c9e)

avoid using delete on DOM nodes (0e98243)

Don’t expose jQuery.acceptData (#2555, 2242719)

Use a PDF object instead of a Java applet for acceptData testing (#1938, 087d280)

do not create data cache when fetching single property (f5bf9bc)

remove the expando when there’s no more data (#1760, 56bb677)

remove some unused code (764dc94)

Deferred

Fix $.when with resolved deferred and progress callbacks (#1894, ab20d9d)

Always handle progress callbacks before done/fail (#2013, #2010, 002240a)

Deprecated

fix amd mode for the deprecated module (e271f66)

Dimensions

properly manipulate non-px values (#1712, 75b3cdd)

allow modification of coordinates argument (#1848, f7e60dc)

Docs

Fix README uppercase (b50e0f2)

remove redundant instruction from the readme (#2359, 3c92770)

correct grunt command in README.md (#1850, 9d6beac)

1.x-master branch -> compat branch; 2.x branch -> master branch (758fd6c)

Clarify custom build instructions (a3779bc)

Add info about Sizzle not being excludable on the compat branch (#2184, 062b526)

Fix various spelling mistakes (360a478)

“npm run build” was missing from the contributing guides (735dea3)

Effects

set default easing using jQuery.easing._default (#2219, 5f2ea40)

Remove tests for jQuery.Animation & jQuery.Tween (a5864ae)

Improve raf logic (708764f)

Finish should call progress (#2283, 3dd3d13)

manually revert two `requestAnimationFrame` commits (0a98623)

add tests for jQuery.easing._default in Animation and Tween (6d7ef56)

Add tests for jQuery.Tween (cdaed15)

Adding unit tests for jQuery.Animation (b3b2d6c)

Reintroduce use of requestAnimationFrame (#15147, 72119e0)

Event

HTML5 drop events inherit from MouseEvent (#2009, d7e5fce)

Ensure delegation doesn’t error on comment nodes (#2055, 493b0fd)

remove preDispatch hook & simplify “simulate” signature (3655c4e)

Copy detail property to jQuery.Event on native events (#1867, d9ed166)

Fully clean up events in unit test (4467ed6)

Update support comments for mouseenter/mouseleave implementation (2792845)

Add a note about a mouseenter bug in Chrome (a5e1c9b)

Empty namespaces should be uneventfully ignored (8653068)

remove outdated originalEvent hack (6df669f)

Remove fake originalEvent from jQuery.Event.simulate (#2300, 7475d5d)

Add basic unit tests for event aliases (#2302, e05c63e)

Fix delegated radio events when arrow keys are used (#2343, c82a668)

Make event aliases optional in unit tests (2cb8eba)

provide verbose comment for focus(in | out) & rename support prop (c074006)

Move .bind() and .delegate() to deprecated (#2288, ee0854f)

Separate trigger/simulate into its own module (#1864, c9935b6)

Move VML test out of event alias test (67fa2ea)

Remove an internal argument to the on method (04a2969)

fix incorrect window bug with scrollTop/Left in iframes (#1945, d21edb5)

fix incorrect test (d923100)

Restore the `constructor` property on jQuery.Event prototype (#15090, b807aed)

Only check elements for delegation matches (9d820fb)

remove redundant guards for the event methods (#2047, a873558)

add support comment (9db9316)

correct support comment (361a0d5)

Normalize mouse event properties in drag events (#1925, 97cf528)

Manipulation

Make an HTML interception point (#1747, 225bde3)

add support to tag-hyphenated elements (#1987, 85ffc6d)

Detect sneaky no-content replaceWith input (#2204, 4b27ae1)

Tolerate XMLNode host object input to getAll (#15151, 1ae025e)

Check state lost if the name is set for Android 4.0-4.3 (1bbb678)

privatize internal domManip() function (#2225, 62d5579)

privatize buildFragment() function (#2224, a74320f)

Remove an internal argument to the remove method (#2301, 349edbd)

Don’t provide the parser with sloppy table markup (#2493, 99e8ff1)

re-expose domManip until 3.0 (#2225, 6ed6bc3)

simplify html wrappers (#2002, 0ea342a)

Switch rnoInnerhtml to a version more performant in IE (#2563, d4def22)

don’t auto-insert tbody (#1835, e984d1c)

Misc

Mac OS is now OS X, thanks @xfq (d30c482)

Fix the tests, revert some unneeded/broken reverts (1ad9915)

Need for speed removed by 9ad6e7e (ff928f5)

Update all references to bugs.jquery.com (#1681, 3e89a53)

Remove leftover -moz-box-sizing in tests (e81b258)

Adjust comments & docs to dropping IE<8 in jQuery Compat (c309b95)

Offset

offsetLeft/Top on empty set returns undefined (#2319, 2937019)

allow offset setter to throw for disconnected elements (#2114, 0d11c11)

allow small differences in offset.top (#2590, 9f9e204)

don’t run scrollTop/scrollLeft iframe test in Android 2.3 & 4.0 (#1981, 0c46643)

add tests for hidden elements + scroll (b041242)

return before getBoundingClientRect to avoid error in IE8-11 (0e4477c)

Round offset value for the sake of floating errors (#2147, 62ae2d0)

return zeros for disconnected/hidden elements (#2310, 40dcc76)

Simplified a conditional (4287442)

account for scroll when calculating position (#1708, 2d71594)

don’t run scrollTop/scrollLeft iframe test in mobile Safari (4ab8603)

simplify jQuery#offsetParent method (74ae544)

do not run tests which break without back-incompat change (9d1d4c2)

Readme

Fix minor style issues. Thanks @MightyBranch! (edfc94d)

Fix punctuation in tile (df62159)

README

Improve build instructions (2e9c1ea)

Update the description of the deprecated module (1d75273)

various text fixes (31b63fc)

Add selector-native.js link. Thanks @randsonjs! (cfe2eae)

update the Homebrew site address (b410b15)

Release

bower.json is actually generated from scratch (61224f5)

update AUTHORS.txt (ae3229c)

Distribute files to distribution repo (#1869, #1673, #2045, 26eca14)

remove antiquated release-notes.js (7bb39f3)

properly set the dist remote when it’s a real release (c44dd77)

remove revert artefacts (3655260)

update AUTHORS.txt (e905dcd)

fix revert artefacts (e2af987)

allow local and github dists (47c21ef)

ensure files are copied to dist (b4e139c)

Remove copying of jquery-latest files (c34ed46)

remove revert artefacts (c69673f)

push dist to same remote as project (1ba45fc)

fix revert artefacts (ae88b39)

remove sourcemap comment from all copies of minified file (#1707, a76c781)

fix CDN archive creation (#1940, e0673df)

dist can be run during a test (aae998b)

Selector

pass jQuery unit tests with selector-native (#1742, #2048, 8804644)

Remove “#” exception for identifier tokens (86e62d8)

Define jQuery.uniqueSort in selector-native too (#2466, bf591fb)

add test for jQuery.unique() alias (add85af)

add jQuery.uniqueSort; deprecate jQuery.unique (#2228, e1090c3)

Serialize

Handle arrays with null values (3d7ce0a)

Fix object detection (14c0fe4)

Sizzle

update to 2.1.1 (7602dc7)

Support

Re-organize browser order, add Safari 8 (43faf6d)

Correct iOS 8 support test results, re-arrange entries (ce308e2)

Tests

Post-Summit cleanup (f931786)

Use standard external domain name (5b554cf)

Make basic tests work in IE 8 (5914b10)

Don’t load non-basic tests when basic module is selected (855b0c8)

Add simple tests for Android 2.3 (#2505, 2c7e9c9)

Lower the checks rounding error (a44cfa0)

Use QUnit URL parameter parsing (f23a64d)

more style corrections (c161eec)

Disable/relax a few tests failing in Android 2.3 (#1785, 1a9c9b0)

further improvements QUnit 2.0 migration (c8d15a2)

fix tests in accordance with new :visible behavior (16713fb)

hotfix for c1511c673148208ab17cafa0faf37bce3b4ae392 (3f839af)

lower the PHP sleep time in unreleasedXHR.html (02e1008)

Fix support tests results for Android 2.3 (4fea389)

Add

Show more