jQuery 4.0.0 Release: Key Features, Breaking Changes, and Migration Guide
jQuery 4.0.0 introduces modernized code, drops legacy browser support, adds Trusted Types and CSP compatibility, migrates the source to ES modules, removes many deprecated APIs, and provides a slimmer build, all accompanied by detailed upgrade instructions and download links.
Overview
On January 14, 2006 John Resig introduced jQuery at a BarCamp in New York. Twenty years later the jQuery team announced the final release of jQuery 4.0.0, the first major version in nearly a decade, containing numerous improvements and modernizations. Most users will need only minimal code changes to upgrade.
Remove IE<11 Support
jQuery 4.0 drops support for IE 10 and earlier. Support for IE 11 will be phased out in a future 5.0 release. The current release also removes legacy browsers such as Edge Legacy, iOS versions older than the last three releases, Firefox versions older than the last two (except ESR), and the Android Browser. Users needing those browsers should stay on jQuery 3.x.
Trusted Types and CSP
jQuery 4.0 adds support for Trusted Types, allowing HTML wrapped in TrustedHTML to be used safely with jQuery methods without violating the require-trusted-types-for CSP directive.
While some AJAX requests previously used <script> tags with attributes like crossdomain, most asynchronous script requests have been switched to <script> tags to avoid CSP errors from inline scripts. In cases where XHR is used with options such as "headers", the preferred approach is now scriptAttrs, but the library prefers <script> whenever possible.
jQuery Source Migrated to ES Modules
The main branch has moved from AMD to ES modules. Previously jQuery was published on npm and GitHub but could not be imported as a module without RequireJS. The team now uses Rollup for bundling and runs all tests on the ES‑module build, enabling native <script type=module> usage.
Removed Deprecated APIs
Several long‑standing, deprecated functions have been removed because native equivalents exist in all supported browsers. The removed functions include: jQuery.isArray, jQuery.parseJSON, jQuery.trim, jQuery.type, jQuery.now, jQuery.isNumeric, jQuery.isFunction, jQuery.isWindow, jQuery.camelCase, jQuery.nodeName, jQuery.cssNumber, jQuery.cssProps, and jQuery.fx.interval.
Developers should replace them with native equivalents such as Array.isArray(), JSON.parse(), String.prototype.trim(), and Date.now(). Removing these APIs and the old IE support code reduces the gzipped size by over 3 KB.
Removed Internal‑Only Methods from jQuery Prototype
Array methods push, sort, and splice have been removed from the jQuery prototype. Code like $elems.push(elem) should be replaced with [].push.call($elems, elem).
Event order inconsistencies across browsers (focusin, focusout, focus, blur) have been resolved; jQuery 4.0 now follows the W3C‑specified order: blur → focusout → focus → focusin. Older versions used a different order, making this a breaking change.
From jQuery 4.0 onward, native browser behavior is no longer overridden (except for IE). All browsers now follow the current W3C spec for event ordering.
Update Slim Build
The slim build is smaller because it removes Deferreds and Callbacks, resulting in a gzipped size of about 19.5 KB. Deferreds implement the Promises/A+ spec, but native Promises can be used in most cases. For IE 11 support, use the full build or add a Promise polyfill.
Download
Files are available via the jQuery CDN or npm:
https://code.jquery.com/jquery-4.0.0.js
https://code.jquery.com/jquery-4.0.0.min.js
npm install [email protected]
Slim Build
The slim version excludes Ajax, effects, and other optional modules, making it roughly 8 KB smaller (gzipped) than the full build. It is available at:
https://code.jquery.com/jquery-4.0.0.slim.js
https://code.jquery.com/jquery-4.0.0.slim.min.js
All files are also published on npm and Bower; see https://jquery.com/download/ for more options.
Thanks
The release thanks contributors Alex, Ahmed S. El‑Afifi, fecore1, Dallas Fraser, Richard Gibson, Michał Gołębiowski‑Owczarek, Pierre Grimaud, Gabriela Gutierrez, Jonathan, Necmettin Karakaya, Anders Kaseorg, Wonseop Kim, Simon Legner, Shashanka Nataraj, Pat O’Callaghan, Christian Oliff, Dimitri Papadopoulos Orfanos, Wonhyoung Park, Bruno PIERRE, Baoshuo Ren, Beatriz Rezener, Sean Robinson, Ed Sanders, Timo Tijhof, Tom, Christian Wenz, ygj6, and the entire jQuery team.
Happy 20th Birthday, jQuery!
Over the past 20 years many people have contributed to jQuery and its ecosystem, gathering for reunions in Dallas and even via Zoom. The release was made while the community celebrated together.
Original article: https://blog.jquery.com/2026/01/17/jquery-4-0-0/
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
