Skip to content

Upgrading jquery 3 to 4

Breaking3.7.1 → 4.0.0Breaking19Platform2Deprecated3New9Changed35Fixed40Other221

BreakingUpgrade verdict

19 breaking changes and 2 platform requirement changes.

  • Requests for JSON are no longer silently converted to JSONP.
  • Calling toggleClass with a boolean or undefined argument is no longer supported.
  • Removes the opacity CSS hook.
  • Drops the root parameter of jQuery.fn.init.
Top 5 of 24 that need code or config changes
Breaking19
Drops the automatic json to jsonp promotion logic.
Drops the toggleClass(boolean|undefined) signature.
toggleClass()
Removes the opacity CSS hook.
opacity
Drops the root parameter of jQuery.fn.init.
jQuery.fn.init
Removes private copies of push, sort and splice from the jQuery prototype.
pushsortsplice
Removes deprecated jQuery APIs.
Renames getStackHook to getErrorHook in Deferred.
getStackHookgetErrorHook
Removes jQuery.trim.
jQuery.trim
Removes jQuery.fx.interval.
jQuery.fx.interval
Removes the event.which shim.
event.which
Removes jQuery.event.global.
jQuery.event.global
Stops auto-executing scripts unless a dataType is provided.
dataType
Stops automatically adding "px" to properties, with a few exceptions.
Moves the factory to separate exports.
Uses named exports in src/.
Migrates from AMD to ES modules.
Stops shimming focusin and focusout events.
focusinfocusout
Makes jQuery.htmlPrefilter an identity function.
jQuery.htmlPrefilter
Drops support for legacy pseudos and tests custom pseudos.
Platform2
Drops support for IE <11, iOS <11, Firefox <65, Android Browser and PhantomJS.
Drops support for Node 10.
Deprecated3
Deprecates Ajax event aliases and moves them into the deprecated module.
Deprecates jQuery.trim.
jQuery.trim
Properly deprecates jQuery.expr[":"] and jQuery.expr.filters.
jQuery.expr[":"]jQuery.expr.filters