UPD: at the request of readers added a list of key changes.
Last Friday, May 20, jQuery 3.0 Release Candidate was released - almost the final version of jQuery 3.0, which you can already try in action. After the release of the third version of jQuery, branches 1.12 and 2.2 will receive critical patches for some time, but will not receive new features or major changes. jQuery 3.0 will not support IE 6, 7 and 8 versions, so if you support these browsers, you can use the latest release 1.12.
')
The jQuery authors expect that the transition to the new version will not cause problems for most users, but it contains some significant changes that may be incompatible with the old code. For such cases, there is a
guide to the transition to the new version and
migration plugin , designed to fix compatibility issues.
Links for jQuery 3.0 Release Candidate:
Full version:
https://code.jquery.com/jquery-3.0.0-rc1.js
Minified:
https://code.jquery.com/jquery-3.0.0-rc1.min.js
There is also the option to install the new version of the plugin via npm:
npm install jquery@3.0.0-rc1
jQuery Migrate 3.0-rc plugin:
Full version:
code.jquery.com/jquery-migrate-3.0.0-rc1.js
Minified:
code.jquery.com/jquery-migrate-3.0.0-rc1.min.js
Installation in npm:
npm install jquery-migrate@3.0.0-rc1
A short list of changes can be found on
the jQuery blog page , a more complete one can be found on
the jQuery Core 3.0 Upgrade Guide page and in the
githaba bug tracker .
List of key changes:
Browser support:
- Internet Explorer: 9+
- Chrome, Edge, Firefox, Safari: current and previous versions
- Opera: current version
- Safari Mobile iOS: 7+
- Android 4.0+
Ajax
- Removed the methods success, error and complete deffered objects from jQuery.ajax - instead, they are suggested to use standard done, fail, and always.
- Cross-domain scripts when querying via jQuery.ajax () and jQuery.get () should be declared as dataType: "script", to prevent the possibility of attacks by sending the script as normal content. In this case, jQuery.getScript () sets the dataType: "script" by default, as before.
- jQuery.ajax () no longer truncates the hash from the URL. If the destination server does not support such an address, you will have to remove the hash yourself.
- jQuery.get () and jQuery.post () now support the settings parameter ( github.com/jquery/jquery/issues/1986 )
Attributes
- .removeAttr () no longer sets the value false for attributes such as checked, selected, and readonly. Instead, if necessary, it is proposed to use .prop ("checked", false)
- Multiple select (select multiple), with an empty list of selected values returns an empty array
- SVG now supports class methods such as .addClass () and .hasClass ()
- The .toggleClass () method with no arguments and .toggleClass (Boolean) has been deprecated - the behavior is still the same, but not recommended for use, and it may be changed in the future.
Core
- jQuery 3.0 works in Strict mode ("use strict")
- Document-ready handlers now work asynchronously
- Removed obsolete properties .context and .selector
- Removed previously undocumented methods jQuery.swap, jQuery.buildFragment, jQuery.domManip
- The methods width (), .height (), .innerWidth (), .innerHeight (), .outerWidth (), .outerHeight (), .offsetTop () and .offsetLeft () now return undefined instead of null
- The for ... of loop can now be used for collections of jquery elements (instead of .each (), for example)
- Formal support for jQuery.ready promise included
- JQuery.unique () renamed jQuery.uniqueSort ()
- jQuery.parseJSON () is deprecated, it is proposed to use native JSON.parse ()
Data
- The .data () method now supports hyphenated names
Deferred
Screen sizes
- Methods .width (), .height (), .css ("width"), and .css ("height") can now return not only integer values
- Methods .width (), .height (), .css ("width"), and .css ("height") of the window object now include the width of the scrollbar
Effects
Developments
- Removed .load (), .unload (), and .error () methods
- Removed ready event from .on ("ready", fn)
- Removed event.pageX and event.pageY normalization
- Removed jQuery.event.props and jQuery.event.fixHooks
- The bind () and .delegate () methods are deprecated.
Manipulation
- .wrapAll (function) now calls a function only once
Offset
- Applying .offset () to an incorrect jquery selector now causes an error
Selectors
- Changed the behavior of selectors: hidden and visible
- jQuery ("#") and .find ("#") are no longer valid selectors
- New jQuery.escapeSelector () method
- Declared obsolete jQuery.expr [":"] and jQuery.expr.filters
Serialization
- jQuery.param () no longer converts% 20 to plus sign
I will be glad to your comments and comments. About errors and shortcomings reported in a personal.
Thank!