Repository navigation
The guide now targets evergreen browsers. Every snippet that was changed is checked against jQuery 4 by a test.
Breaking: Internet Explorer is no longer supported
Snippets target the latest Chrome, Edge, Firefox, Safari and Opera. IE-specific fallbacks are gone: vendor-prefixed matchesSelector, the closest polyfill, Array.prototype.*.call, createEvent / initCustomEvent, pageYOffset, parentNode.removeChild. If you still need IE, use the last IE-compatible version or v2.0.
Native one-liners
| jQuery | Native |
|---|---|
remove / insertBefore / insertAfter |
el.remove() / el.before() / el.after() |
empty |
el.replaceChildren() |
unwrap / replaceWith |
parent.replaceWith(...parent.childNodes) / el.replaceWith() |
$(html) |
<template> |
$.extend(true, …) |
structuredClone() |
$.Deferred |
Promise.withResolvers() |
scrollTop() |
window.scrollY |
outerHeight() / outerWidth() |
el.offsetHeight / el.offsetWidth |
New sections
- Request JSON (with the
response.okgotcha), Post JSON, Abort and timeout one→{ once: true }, event delegation, removing several listeners at once withAbortControllerasync/awaitvariants foralwaysandthen- Effects use the Web Animations API (
el.animate());slideUp/slideDownmeasure real height
Fixed snippets
Snippets that threw or disagreed with jQuery: nextAll / prevAll, :contains, append / prepend with HTML strings, clone (now deep), trigger, inArray, isPlainObject(null), merge, globalEval, parseHTML, Deferred, fadeOut, fadeTo, animate. Plus broken markdown, anchors and syntax errors in the README (#264).
Tests and tooling
- Karma / webpack 1 / Babel 6 replaced with Vitest + jsdom; tests run in GitHub Actions on PRs and
master - Travis CI config and badges removed (#263)
Translations
All 15 translations are synced with the current snippets (#268–#282).
Full changelog: v2.0...v3.0