jQuery 4.0.0 Is Here: What Changed, What Broke, and How to Upgrade Safely
Twenty years after John Resig first introduced jQuery at BarCamp NYC (January 14, 2006), the project has shipped jQuery 4.0.0 as a final release. It’s the first major version bump in almost 10 years, it’s packed with cleanup and modernization-and yes, there are breaking changes. The good news: the jQuery team expects most codebases to upgrade with only small adjustments, as long as you review the changes before flipping the switch.
This release is largely about doing the things that simply couldn’t happen in a minor or patch version: trimming legacy paths, removing APIs that had been deprecated for multiple releases, dropping undocumented internal-only parameters that leaked into public functions, and simplifying “magic” behaviors that made the codebase harder to maintain.
If you’re planning an upgrade, start with the official resources: the jQuery 4.x upgrade guide and the jQuery Migrate plugin. And if you hit a bug, report it in the main tracker: jquery/jquery issues.
How to get jQuery 4.0.0 (CDN, npm, and the slim build)
jQuery 4.0.0 is published on the official jQuery CDN and via npm. Third-party CDNs usually follow shortly after, but their timing isn’t controlled by the jQuery team.
- CDN (unminified): https://code.jquery.com/jquery-4.0.0.js
- CDN (minified): https://code.jquery.com/jquery-4.0.0.min.js
- npm:
npm install jquery@4.0.0
Slim build downloads
The slim build exists for cases where you don’t want the full surface area (for example, you’re using a dedicated AJAX library, you avoid jQuery animations, or you want to lean on native browser capabilities like Promises). In jQuery 4.0.0, the slim build is even smaller-in particular because it now excludes Deferreds and Callbacks, landing at about 19.5kB gzipped.
- Slim (unminified): https://code.jquery.com/jquery-4.0.0.slim.js
- Slim (minified): https://code.jquery.com/jquery-4.0.0.slim.min.js
Slim build + IE11
Native Promises are available everywhere jQuery 4 supports except IE11. If you must support IE11, use the main build or ship a Promise polyfill. Deferreds offer features beyond native Promises, but most common patterns can be migrated to Promise methods.
Breaking change: IE < 11 (and other very old browsers) are gone
jQuery 4.0 drops support for IE 10 and older. The obvious follow-up question is “why not IE 11 too?” The jQuery team is removing support in stages; IE 11 removal is planned for the next major step and is tracked for jQuery 5.0 (see https://github.com/jquery/jquery/pull/5077). For 4.0, the focus is on removing code that specifically existed to support IE versions older than 11.
Alongside that, jQuery 4.0 also drops support for several other legacy platforms:
- Edge Legacy (non-Chromium Edge)
- iOS versions earlier than the last 3
- Firefox versions earlier than the last 2 (aside from Firefox ESR)
- Android Browser
In most apps, no code changes are required just because these browsers are no longer supported. But if your requirements still include any of them, the practical answer is simple: stay on jQuery 3.x.
Security modernization: Trusted Types + better CSP compatibility
One of the most impactful upgrades in jQuery 4.0 is support for Trusted Types-a browser security feature that helps prevent DOM XSS by restricting dangerous sinks (like setting innerHTML) to only accept vetted values. With Trusted Types enabled, HTML wrapped in TrustedHTML can now be used as input to jQuery manipulation methods without violating the require-trusted-types-for Content Security Policy (CSP) directive.
In parallel, jQuery has been tightening CSP behavior around script loading. Some AJAX requests already used <script> tags to preserve attributes like crossdomain, and now most asynchronous script requests have switched to using <script> tags specifically to avoid CSP errors caused by inline script execution. There are still a few situations where XHR is used for async script requests-for example, when the headers option is passed (the release notes explicitly recommend using scriptAttrs instead)-but the default behavior is to use a <script> tag whenever possible.
The codebase is now ES modules (ESM), not AMD
A big internal milestone in the jQuery 4 era is that the source code on main migrated from AMD (the asynchronous module definition format commonly associated with RequireJS) to ES modules (ESM).
Historically, jQuery shipped its source in npm/GitHub, but you couldn’t import it directly as modules without RequireJS, because that was also the build tool of choice. The project has now switched to Rollup for packaging, runs tests for the ESM build separately, and-crucially-this makes jQuery significantly friendlier to modern tooling and browsers (including <script type=module> workflows).
Deprecated APIs removed (and what to use instead)
jQuery 4.0 removes a set of functions that had been deprecated for multiple versions-either because they were always intended to be internal helpers or because every supported browser now has a native equivalent. The removed APIs are:
jQuery.isArrayjQuery.parseJSONjQuery.trimjQuery.typejQuery.nowjQuery.isNumericjQuery.isFunctionjQuery.isWindowjQuery.camelCasejQuery.nodeNamejQuery.cssNumberjQuery.cssPropsjQuery.fx.interval
In practice, the upgrade path is to use native equivalents such as Array.isArray(), JSON.parse(), String.prototype.trim(), and Date.now().
This cleanup-combined with removing old IE support paths-reduced the library size by over 3kB gzipped.
Internal-only Array methods removed from the jQuery prototype
For a long time, the jQuery prototype included a few Array methods that didn’t behave like typical chainable jQuery APIs and were effectively internal-only. In jQuery 4.0, these have been removed from the prototype:
pushsortsplice
If your code relied on them, you can still use Array methods by borrowing them from Array.prototype:
// jQuery 4: push/sort/splice are no longer on the jQuery prototype
// Old (no longer works):
// $elems.push(elem)
// New: borrow from Array.prototype
[].push.call($elems, elem);
Focus and blur events now follow the W3C event order
This is a subtle but real breaking change if you have complex focus management. Historically, browsers disagreed on the order of focus-related events (focusin, focusout, focus, blur). jQuery enforced a consistent ordering for years-but modern browsers have converged on a shared order that matches the current W3C specification, and it differs from what jQuery did previously.
As of jQuery 4.0, jQuery no longer overrides native behavior. That means all browsers except IE follow the current W3C spec ordering:
- blur
- focusout
- focus
- focusin
In jQuery 3.x and earlier, jQuery’s consistent ordering was: focusout, blur, focusin, focus. A fun historical footnote from the release notes: Internet Explorer was the only browser that followed the old W3C spec order (before the spec was updated in 2023).
What else changed? Notes from the 4.0.0 changelog
Beyond the headline items, 4.0.0 includes a long list of fixes and behavioral adjustments across core modules. A few notable themes stand out in the official changelog: AJAX transport hardening (including CSP-related script transport behavior), selector work (including module restructuring and native alignment), and a broad push to simplify internals after the browser support reduction.
If you need the full commit-by-commit details, the release points to the complete comparison: Full changelog: 4.0.0.
Upgrade workflow: minimize risk with the official guide + Migrate
The safest way to move a mature codebase from jQuery 3.x to 4.0 is to treat it as an intentional migration rather than a drive-by dependency bump:
- Read the official upgrade guide: https://jquery.com/upgrade-guide/4.0/
- Add the jQuery Migrate plugin during the transition: https://github.com/jquery/jquery-migrate/
- Test focus-heavy UI flows (modals, menus, custom inputs) because of the focus/blur ordering change
- Audit usage of removed APIs (especially
jQuery.trim,jQuery.parseJSON, andjQuery.isFunction) and switch to native alternatives - If you used
$elems.push/sort/splice, update those call sites to useArray.prototypeborrowing - Confirm your CSP policy and script-loading behavior if you rely on jQuery’s script transport features
- If you still need legacy browser support (IE<11, Edge Legacy, old iOS/Firefox, Android Browser), do not upgrade-stay on jQuery 3.x
A 20-year milestone (and a reunion photo)
jQuery 4.0.0 lands right on the project’s 20-year anniversary, and the release notes mention a team reunion in Dallas-with John Resig joining over Zoom. The post itself was published while the group was together.

Summary: why jQuery 4.0 matters even in 2026
jQuery 4.0.0 is not about chasing trends-it’s about keeping a widely-embedded library healthy in a modern web environment. Dropping older browsers unlocks simpler code paths, the ESM migration improves compatibility with current build tooling, CSP/Trusted Types support aligns with today’s security expectations, and long-deprecated APIs finally leave the surface area. If you’re still shipping jQuery (and many WordPress and legacy-enterprise stacks are), 4.0.0 is a pragmatic step forward-just take the breaking changes seriously and lean on the official upgrade guide and Migrate plugin.
References / Sources
- jQuery 4.0.0
- jQuery Upgrade Guide (4.0)
- jQuery Migrate plugin release
- Full changelog: 4.0.0 (3.7.1…4.0.0)
- jQuery 5.0 IE11 support removal discussion (PR #5077)
- jQuery download (CDN and install options)
- jQuery issues tracker
- TrustedHTML (MDN)
- Trusted Types reference (tweet)
- Promises/A+ specification
- AMD background (RequireJS)
- Rollup introduction
Emma Richardson
UI/UX designer and frontend developer. React and the modern JavaScript ecosystem are my expertise. Passionate about user experience and accessibility.
All posts