Upgrading to Version 4.x
As of now, the jQuery team has released a new version β it's still just a beta, but I think the main changes are already in, and ahead of us is the stable release with minor bug fixes.
The highlights:
dropped the "baggage" of old browsers: Internet Explorer 10, Edge Legacy, iOS <11, Firefox <65, and Android Browser;
they promise to drop Internet Explorer 11 in jQuery 5.0
removed about a dozen functions that were declared deprecated in 3.x:
event shorthand methods:
click(),dblclick(),mouseenter(),mouseleave(),hover(),keydown(),keyup(),keypress(),focus(),blur(),change(),submit(), and others β useon()andtrigger()instead;the
keypressevent β usekeydown/keyup;$.isArray()β useArray.isArray();$.type()β usetypeoforinstanceof;$.isFunction()β usetypeof fn === "function";$.isWindow()β usewindow === obj;$.now()β useDate.now();$.proxy()β useFunction.prototype.bind();$.trim()β useString.prototype.trim();$.parseJSON()β useJSON.parse();
sorted out the event order:
blur->focusout->focus->focusinβ now it's this way and only this way, in accordance with the new W3C edition;now only IE has a different order, and the irony is that only IE followed the previous W3C edition, and only in 2023 was the spec changed to match the implementation in modern browsers
added binary data support in
$.ajax();removed automatic JSON-as-JSONP processing β now for such requests you need to explicitly specify that you want a JSONP response from the server;
the framework has fully migrated from AMD to ES modules;
added Trusted Types support to eliminate Content Security Policy errors in the console.
The list seems short, and I think upgrading to jQuery 4.0 shouldn't cause any problems.
Last updated