jQuery Changelog

What's new in jQuery 3.7.1

Aug 28, 2023
  • Support Test for Table Rows:
  • jQuery 3.6.0 introduced a change to a support test to account for a sudden failure from Firefox, which started including table borders in computed dimensions for elements. That may be actually be correct, but Firefox is the only browser doing it. However, that new support test didn’t account for pages with * { box-sizing: border-box; } in CSS. And so, the support test failed on those pages in all browsers. The result was a fallback to use outerWidth and outerHeight, which unfortunately doesn’t return fractional values. The support test has now been fixed and previous behavior has been restored for Chrome and Safari, but Firefox and IE will continue to return integers.
  • Re-exposing Methods from Sizzle:
  • jQuery has inlined most of the code from Sizzle in jQuery 3.7.0 in preparation for larger changes coming to the jQuery selector engine in the future. For the most part, there were no functional changes, but we did accidentally privatize a method that used to be public. While jQuery.find.tokenize was not documented, some code relied on it being available. That method has now been restored.

New in jQuery 3.7.0 (May 12, 2023)

  • jQuery 3.7.0 Released: Staying in Order
  • Posted on May 11, 2023 by Timmy Willison
  • jQuery 3.7.0 is now available! This release has it all: bug fixes, a new method, and a performance improvement! We even dropped our longtime selector engine: Sizzle. Or, I should say, we moved it into jQuery. jQuery no longer depends on Sizzle as a separate project, but has instead dropped its code directly into jQuery core. This helps us prepare for the major changes coming to selection in future jQuery versions. That doesn’t mean much right now, but jQuery did drop a few bytes because Sizzle supports even older browsers than jQuery. As an aside, we do plan on archiving Sizzle, but we’ll have more details on that in a future blog post.
  • As usual, the release is available on our cdn and the npm package manager. Other third party CDNs will probably have it soon as well, but remember that we don’t control their release schedules and they will need some time. Here are the highlights for jQuery 3.7.0.
  • New method: .uniqueSort()
  • Some APIs, like .prevAll(), return elements in reverse order, which can result in some confusing behavior when used with wrapping methods. For example,
  • $elem.prevAll().wrapAll("")
  • The above would wrap all of the elements as expected, but it would write those elements to the DOM in reverse order. To solve this in a way that prevented breaking existing code, we’ve documented that .prevAll() and similar methods return reverse-order collections, which is still desirable in many cases. But we’ve also added a new method to make things easier: a chainable .uniqueSort(), which does the equivalent of the existing but static jQuery.uniqueSort().
  • So, our previous example would become:
  • $elem.prevAll().uniqueSort().wrapAll("")
  • and the element order in the DOM would remain the same.
  • Added some unitless CSS properties
  • jQuery 3.7.0 adds support for more CSS properties that should not automatically have “px” added to them when they are set without units. For instance, .css('aspect-ratio', 5) would result in the CSS aspect-ratio: 5px;. All in all, we added seven more properties, and we got a little help with our list from React. Thanks, React!
  • It’s worth noting that jQuery 4.0 will change the way we handle unitless CSS properties. Rather than relying on a list of CSS properties to avoid adding "px", we’ll instead have an list of properties to which we definitely want to add "px" when there are no units passed. That should be more future-proof.
  • Performance improvement in manipulation
  • jQuery 3.7.0 comes with a measurable performance improvement for some use cases when using manipulation methods like .append(). When we removed a support test for a browser we no longer support, it meant that checks against document changes no longer needed to run at all. Essentially, that resulted in a speedup anywhere between 0% and 100%. The most significant speedup will be for some rare cases where users frequently switch contexts between different documents, perhaps by running manipulations across multiple iframes.
  • Negative margins in outerHeight(true)
  • Back in jQuery 3.3.0, we fixed an issue to include scroll gutters in the calculations for .innerWidth() and .innerHeight(). However, that fix didn’t take negative margins into account, which meant that .outerWidth(true) and .outerHeight(true) no longer respected negative margins. We’ve fixed that in 3.7.0 by separating the margin calculations from the scroll gutter adjustments.
  • Using different native focus events in IE
  • Focus and blur events are probably the most complicated events jQuery has to deal with across browsers. jQuery 3.4.0 introduced some minor regressions when it fixed an issue with the data passed through focus events. We were finally able to close all of those tickets in jQuery 3.7.0!
  • But, we need to point out a possible breaking change in IE. In all versions of IE, focus & blur events are fired asynchronously. In all other browsers, those events are fired synchronously. The asynchronous behavior in IE caused issues. The fix was to change which events we used natively. Fortunately, focusin & focusout are run synchronously in IE, and so we now simulate focus via focusin and blur via focusout in IE. That one change allowed us to rely on synchronous focus events in IE, which solved a lot of issues (see the changelog for the full list).
  • If you’re curious, support for IE will be dropped in jQuery 4.0 and many of those changes are already in our main branch.

New in jQuery 3.6.0 (Jun 18, 2021)

  • jQuery 3.6.0 has been released! In jQuery 3.5.0, the major change was a security fix for the html prefilter. This release does not include a security fix, but does have some good bug fixes and improvements. We still have our eyes on a jQuery 4.0 release, but until then we will continue to support the 3.x branch and address important issues.

New in jQuery 3.2.1 (Apr 11, 2017)

  • Core:
  • Ensure jQuery.holdReady is in the right place (#3573, fcc9a9ec)
  • Dimensions:
  • Ensure we get proper values for width and height on elements with display “inline” (#3571, 473d2ea7)
  • Event:
  • Ensure trigger data is passed to radio click event handlers (#3579, a6b07052)
  • Revert: Trigger checkbox and radio click events identically (35785a32).
  • Revert: Add radio click triggering tests (4d6b4536).

New in jQuery 3.2.0 (Mar 17, 2017)

  • Notable Updates:
  • Added support for custom CSS properties (#3144).
  • Deprecated jQuery.holdReady (#3288).
  • Deprecated jQuery.nodeName (#3475).
  • Deprecated jQuery.inArray (#2961).
  • Fixed a bug in .width(), .height(), and related methods where CSS transforms were included in the calculations. For instance, an element with the style transform: scale(2x) should not have its width and height values doubled (#3193).
  • Added support for elements to the .contents() method (#3436).
  • Added back the deprecated module to the slim build. This change is largely insignificant given the module’s small size. We believe it makes more sense to remove deprecated pieces from the slim build at the same time as the main jQuery build (#3237).

New in jQuery 3.1.1 (Sep 23, 2016)

  • Fixed a selector issue with disabled options, exposed jQuery.noConflict even when jQuery is loaded with AMD, and fixed some issues concerning whitespace.

New in jQuery 3.1.0 (Jul 15, 2016)

  • Not so long ago, we released jQuery 3.0. One of the major features of jQuery 3.0 was a small rewrite of jQuery Deferreds. Specifically, we made them compatible with the Promises/A+ spec. That basically meant that errors had to be silenced and passed as rejection values to rejection handlers (added using deferred.catch()). This had the advantage of preventing Promise handlers from getting blocked up by runtime errors, but the disadvantage of errors being silenced if no rejection handlers were added. While this was the right move for Deferreds, we had also changed jQuery.ready and jQuery.fn.ready to use the new spec-compliant Deferreds under the covers.
  • Unfortunately, if you were using the usual ways to attach ready handlers (e.g. jQuery(function() {}) and jQuery(document).ready(function() {})), you had no way to add a rejection handler. Plus, it wasn’t obvious that you were in Deferred land. Any runtime exceptions were getting swallowed and lost in space. I think they ended up somewhere near Pluto, which isn’t even a planet anymore! There were workarounds, but this wasn’t acceptable to us.
  • We immediately set out to fix this, and thus jQuery 3.1.0 was born. No longer will errors be silent! You will see them logged to the console by default. If you’d like to have more control on how these errors are handled, we also added an entry point: jQuery.readyException. In most cases, you won’t need to use it, but any errors that are thrown within a ready handler will get passed to this function should you need it.
  • The default jQuery.readyException will re-throw the error asynchronously, to avoid stopping execution and log the error to the console. We hope this solves any debugging issues you may have experienced when using jQuery 3.0.

New in jQuery 3.0.0 (Jun 10, 2016)

  • Removed all of the old IE workarounds and taken advantage of some of the more modern web APIs where it made sense. It is a continuation of the 2.x branch, but with a few breaking changes that we felt were long overdue. While the 1.12 and 2.2 branches will continue to receive critical support patches for a time, they will not get any new features or major revisions. jQuery 3.0 is the future of jQuery. If you need IE6-8 support, you can continue to use the latest 1.12 release.
  • Ajax:
  • Golf away 21 bytes (eaa3e9f)
  • Preserve URL hash on requests (#1732, e077ffb)
  • Execute jQuery#load callback with correct context (#3035, 5d20a3c)
  • Ensure ajaxSettings.traditional is still honored (#3023, df2051c)
  • Remove unnecessary use of jQuery.trim (0bd98b1)
  • Attributes:
  • Avoid infinite recursion on non-lowercase attribute getters (#3133, e06fda6)
  • Add a support comment & fix a link @ tabIndex hook (9cb89bf)
  • Strip/collapse whitespace for set values on selects (#2978, 7052698)
  • Remove redundant parent check (b43a368)
  • Fix setting selected on an option in IE pseudos (#2073, 0402963)
  • Update Sizzle to 2.3.0 (5c4be05)
  • Add jQuery.escapeSelector (#1761, 25068bf)
  • Serialize:
  • Treat literal and function-returned null/undefined the same (#3005, 9fdbdd3)
  • Reduce size (91850ec)
  • Support:
  • Improve support properties computation (#3018, 44cb97e)
  • Tests:
  • Take Safari 9.1 into account (234a2d8)
  • Limit selection to #qunit-fixture in attributes.js (ddb2c06)
  • Set Edge’s expected support for clearCloneStyle to true (28f0329)
  • Fix Deferred tests in Android 5.0’s stock Chrome browser & Yandex.Browser (5c01cb1)
  • Add additional test for jQuery.isPlainObject (728ea2f)
  • Build: update QUnit and fix incorrect test (b97c8d3)
  • Fix manipulation tests in Android 4.4 (0b0d4c6)
  • Remove side-effects of one attributes test (f9ea869)
  • Account for new offset tests (f52fa81)
  • Make iframe tests wait after checking isReady (08d73d7)
  • Refactor testIframe() to make it DRYer and more consistent (e5ffcb0)
  • Weaken sync-assumption from jQuery.when to jQuery.ready.then (f496182)
  • Test element position outside view (#2909, a2f63ff)
  • Make the regex catching Safari 9.0/9.1 more resilient (7f2ebd2)
  • Traversing:
  • .not/.filter consistency with non-elements (#2808, 0e2f8f9)
  • Never let .closest() match positional selectors (#2796, a268f52)
  • Restore jQuery push behavior in .find (#2370, 4d3050b)

New in jQuery 2.2.3 (May 7, 2016)

  • These are small releases with a couple bug fixes. There was a minor issue that made the 1.x branch inconsistent with 2.x and a recently-introduced bug in both branches that affected the .load method.

New in jQuery 2.1.3 (Dec 29, 2014)

  • Several bug fixes to make your cross-browser development experience better.
  • The most significant fix in this release is a workaround for a serious querySelector bug in Safari 8.0 and 7.1. When this bug popped up we were hopeful that it would be fixed in patch releases but that did not happen. Apple is by far the least transparent browser maker, and we have very little information about when the Webkit patch for this bug might be pulled into Safari. As a result, we have decided to patch this in Sizzle, the selector engine used by jQuery.
  • A bug like this one emphasizes the benefit of using a library like jQuery rather than going directly to the DOM APIs. Even modern browsers can suffer from bugs that aren’t fixed for a long time, and there are still cross-browser feature differences with several browsers in wide use such as Android 2.3. Special-case code for obscure browser issues can seem unnecessary until you spend a day trying to debug a problem in your own code caused by one. Or worse, lose a paying customer because they couldn’t use your site from their old phone.
  • Another bug that makes it difficult for us to test jQuery on iOS 8 is that the user agent of the simulator is incorrect so the iOS 8 simulator is not recognized by our unit test infrastructure. The fix for that issue is very simple but Apple won’t tell us if we can count on it being done. For now we’re doing our iOS 8 testing manually.
  • In addition, this release includes several changes inside jQuery to avoid holding onto DOM elements unnecessarily. Although the old code generally wouldn’t cause things to run incorrectly, web pages might run slowly and use more memory than necessary.

New in jQuery 2.1.1 (May 3, 2014)

  • jQuery 2.1.1:
  • Ajax:
  • #14683: ajax: Exceptions thrown synchronously by xhr.send are not caught
  • Attributes:
  • #14756: Simplify an option hook
  • Core:
  • #14746: Remove special case try/catch in isPlainObject
  • #14794: String.prototype.trim doesn’t trim Unicode whitespaces in Android

New in jQuery 2.1.0 (Jan 25, 2014)

  • HIGHLIGHTS:
  • Fewer forced layouts: In this release we declared war on places where we might inadvertently force the browser to do a time-consuming layout. We found a few and eliminated one in particular that could occur when changing class names. This can result in a big performance boost for some pages.
  • Granular custom builds: Our modularity is now defined by AMD, and it is easier to build small subsets of the library when space is at a premium. If you want to know more, we’ve hidden the details in the README file where nobody ever looks.
  • Lower startup overhead: The new modularity and avoidance of forced layouts led us to refactor our feature detects so that they run the first time they’re needed. If you never call the API needing that feature detect, you never run that code. Previously we ran all feature detects when the page loaded, that led to delays that were generally small, but added up–especially on mobile platforms.
  • Published on npm: Our releases will now be published on npm so that you can use them with node or browserify. Both the 1.x and 2.x branches are available on npm, but remember that only the 2.x branch is supported to run in node.
  • Published on Bower: We’re now using Bower for our internal dependency management including Sizzle, so you’ll see jQuery releases on Bower as soon as they’re available.
  • CHANGES:
  • jQuery 1.11 and 2.1:
  • Ajax:
  • #14036: ajaxLocation Includes HTTP Basic Authentication Info
  • #14356: Remove string indexing used in AJAX
  • #14379: Issue with xhr.js
  • Attributes:
  • #14250: addClass and removeClass needlessly assign to className.
  • Build:
  • #12757: Enforce style guide via build process
  • #13983: Switch to //# for sourcemap directives
  • #14016: Include a build option for customizing exports
  • #14113: AMD-ify jQuery source
  • #14118: Use bower to include Sizzle and QUnit (remove submodules)
  • #14163: Make Deferreds/Callbacks/.ready() optional modules
  • #14415: Remove sourcemap comment
  • #14450: Remove CommonJS+AMD syntax from source
  • #14451: Add bower and npm registrations to release script
  • #14504: Build: Upgrade to grunt-contrib-jshint 0.7.1 and squash subtasks
  • #14615: Manage bower dependencies with grunt-bowercopy
  • #14702: Problem with npm package for jquery ‘latest’
  • Core:
  • #14164: Reduce forced layout reflows in init or methods
  • #14492: parseJSON incorrectly accepts comma expressions
  • #14548: npm jQuery does not have a main module
  • #14549: npm jQuery does not expose the jQuery function, but instead a wierd factory
  • #14645: Remove global exposure for CommonJS environments with a document
  • Css:
  • #14150: IE9-10 curCSS => “Interface not supported” in for popups (and probably frames)
  • #14394: style=”x: y !important;” doesn’t get changed when calling el.css(x, z) in Chrome and Safari but it works in Firefox
  • Data:
  • #14101: Version 1.10 .data() differs from 1.8 when getting data from non-existent object
  • #14459: data-* attribute parsing bypasses jQuery.parseJSON (inconsistent with 1.x)
  • Effects:
  • #14344: Putting different effects in callbacks uses only the first effect.
  • Event:
  • #13993: .triggerHandler doesn’t return value from handler for DOM0 events
  • #14180: focusin/out special events don’t work cross-window
  • #14282: Don’t call getPreventDefault() if there is a defaultPrevented property
  • Manipulation:
  • #14716: Textarea isn’t cloned properly in IE11
  • Misc:
  • #14040: Tests: Replace QUnit.reset usage
  • Selector:
  • #14142: Wrong number of elements returned in XML document with numeric IDs in Safari
  • #14351: Exception thrown when running `find` in a non-attached DOM node
  • #14381: .add() throws “no such interface” in IE when adding nodes from another window
  • #14535: Selection fails in IE11 when the last context is a no-longer-present iframe document
  • #14584: Attribute Ends With case-insensitive in some IE8
  • Support:
  • #10814: make support as lazy as possible with closure in mind
  • #14084: elem.css(‘width’) provides incorrect output with `box-sizing: border-box` if run before document ready
  • #14401: Error when loading a page with application/xhtml+xml
  • #14496: jQuery 2.1.0-beta1 fails to initialize in a XHTML page
  • jQuery 2.1:
  • Ajax:
  • #14207: Ajax error defaults to status 404
  • Build:
  • #13119: Make jQuery releases available via npm
  • #13768: Error trying to load jQuery from node.js
  • #14340: Remove oldIE code from support tests on master
  • Core:
  • #14313: Optimize jQuery.merge for size
  • Event:
  • #14544: Remove elem reference from event handler

New in jQuery 2.0.3 (Jul 4, 2013)

  • Build:
  • #13371: Update node-testswarm to 1.0
  • Css:
  • #14049: -webkit-order doesn’t work with css()
  • Selector:
  • #13974: Accessing XML attribute named “type” broken on IE 7
  • #13980: JQuery library does not load in Opera 12.15 and IE 10 in IFrame which content is loaded from external domain
  • Data:
  • #14047: $.data() can’t retrieve data stored by .data() when key is hyphenated
  • Manipulation:
  • #13976: Invalid HTML passed into .html() throws ‘tmp is null’ error

New in jQuery 2.0.2 (Jul 4, 2013)

  • Effects:
  • #13937: finish() only finishes last item of a set being .animate()d.
  • #13939: 1.10.0 breaks relative animation
  • Selector:
  • #13936: SCRIPT70 Permission denied in selectors after iframe was submitted in IE9-10, jQuery 1.9.1 and 2.0.0

New in jQuery 2.0.1 (May 25, 2013)

  • Ajax:
  • #13922: HEAD responses with application/json results parseerror
  • Attributes:
  • #13809: Closure Compiler/YUI Compressor fail
  • Data:
  • #13815: Setting data property with data(object) produces different results than data(key, value)
  • #13850: .data() and removeData() doesn’t work correctly with hyphenated property
  • Effects:
  • #13855: Problems animating line-height property
  • Event:
  • #13554: Move [un]bind & [un]delegate to event-alias
  • #13255: jQuery 2.0b1 and Cordova 2.3.0 cause “Uncaught TypeError: Cannot read property ‘nodeType’ of null”.
  • Manipulation:
  • #13803: XMLHttpRequest cannot load
  • #13818: Creation of `col` elements inconsistancy
  • Selector:
  • #13577: New minimal selector engine fails on textNode objects
  • Traversing:
  • #13819: Selection through children results in descending order
  • #13846: jQuery 2.0.0 reversing order of returned elements

New in jQuery 2.0.0 (Apr 19, 2013)

  • Ajax:
  • #12838: domManip script evaluation implementations with alternate signatures
  • #13276: In IE 9/10 $.parseXML() returning document object instead of XMLDOMDocument
  • #13292: $.ajax with 1.9.0 doesn’t call anymore success function in case of 204
  • #13306: File input added to serialized forms caused a change in behavior and only halfway follows spec
  • #13388: Ajax request not returning responseXML
  • Attributes:
  • #12072: Remove Firefox deprecated nodeValue, getAttributeNode, specified
  • Build:
  • #12656: Make event shorthands an excludable module
  • #13316: Check against jquery.min.js with TestSwarm
  • #13335: “use strict”; break asp.net ajax postacks in FF
  • #13741: Make wrap*/unwrap methods an optional module
  • #13744: Move jQuery.fn.size() to deprecated
  • #13755: Update .jshintrc to match style guide
  • #13759: Better undefined gzip compression
  • #13760: getComputedStyle no longer works in node with jsdom
  • #13776: License comment is breaking the SourceMap
  • Core:
  • #13356: Consistently clean up after .ready() handler
  • Css:
  • #13310: hide() and fadein() corrupt the css display value
  • Deferred:
  • #13150: Be able to determine if $.Callback() has functions
  • Effects:
  • #12846: overflow:hidden is not removed when .stop() is called
  • #13183: Wrong animation initial value calculation (1.9.0rc1)
  • #13483: Issue with stop(true).slideDown() during slideUp()
  • Event:
  • #13360: Creating String.prototype.namespace can cause an exception in jQuery.Event
  • #11570: Move element cache to the element[expando] to avoid cleanup and reduce code.
  • #13143: e.target can be a text node on mousewheel
  • #13554: Move [un]bind & [un]delegate to event-alias
  • Manipulation:
  • #13232: In 2.0beta1, using html() function on a tbody selector yields insertion of new tbody
  • #13233: Unexpected behavior when iterating over and manipulating detached nodes in jquery 1.9
  • #13282: QtWebKit — TypeError: ‘[object Object]‘ is not a valid argument for ‘Function.prototype.apply’ (evaluating ‘elem.nodeType’)
  • #13596: .replaceWith should always remove the context set
  • #13721: remove(“:nth-child(1)”) works differently than filter(“:nth-child(1)”).remove()
  • #13722: .replaceWith argument handling is inconsistent with other manipulation methods
  • #13779: .remove() changed in beta3 – now remove nodes in reverse doc order
  • Selector:
  • #13434: Create querySelectorAll/matchesSelector selector option
  • #13331: jQuery.fn.add returns incorrect order in Chrome and Safari
  • #13378: ie8 & ie9 iframe – .filter(“:focus”) – document.activeElement returns unspecified error.
  • #13420: jQuery 1.9.1 fails to filter SVG parent nodes by class name when using .parent() and .closest()
  • #13499: Descendant selector fails when searched ID doesn’t exists but NAME does (IE7 only)
  • #13505: jquery#add: seems to get items in collection out of order on larger lists
  • Support:
  • #10814: make support as lazy as possible with closure in mind
  • #12040: Test against Content Security Policy (CSP)
  • #13089: support adds zoom style to body in Chrome/Safari
  • #13743: Remove jQuery.support.boxModel
  • Traversing:
  • #13265: parent method fails with text nodes in IE10
  • #13332: .closest(“*”) yields input even for non-element nodes
  • #13349: find function slower since 1.9.0, especially in chrome

New in jQuery 1.6.1 (Mar 13, 2013)

  • Ajax:
  • #13276: In IE 9/10 $.parseXML() returning document object instead of XMLDOMDocument
  • #13292: $.ajax with 1.9.0 doesn’t call anymore success function in case of 204
  • #13306: File input added to serialized forms caused a change in behavior and only halfway follows spec
  • Build:
  • #12656: Make event shorthands an excludable module
  • #13274: IE < 9: “‘jquery’ is undefined” w/ sourceMappingURL comment
  • #13316: Check against jquery.min.js with TestSwarm
  • #13335: “use strict”; break asp.net ajax postacks in FF
  • Deferred:
  • #13150: Be able to determine if $.Callback() has functions
  • Effects:
  • #12846: overflow:hidden is not removed when .stop() is called
  • #13183: Wrong animation initial value calculation (1.9.0rc1)
  • Event:
  • #13208: JS error trying to get the id of the document in IE8
  • #13360: Creating String.prototype.namespace can cause an exception in jQuery.Event
  • Manipulation:
  • #13282: QtWebKit — TypeError: ‘[object Object]‘ is not a valid argument for ‘Function.prototype.apply’ (evaluating ‘elem.nodeType’)
  • #13315: minified manipulation methods fail on oldIE with XML
  • #13233: Unexpected behavior when iterating over and manipulating detached nodes in jquery 1.9
  • Selector:
  • #13182: nested has selectors broken in IE7 & IE8 in versions 1.8.2+
  • #13281: Wrong order when using .find() in IE7/8
  • #13331: jQuery.fn.add returns incorrect order in Chrome and Safari
  • Support:
  • #13089: support adds zoom style to body in Chrome/Safari
  • Traversing:
  • #13349: find function slower since 1.9.0, especially in chrome