Osama Abu Quboh
Sr. Front End Engineer
@osa_aq
Bayt.com
With the major version of 3.0, the jQuery Core
team has taken the opportunity to make
changes to clean up the API and fix bugs that
may prove to be breaking changes for some
code. This includes the removal of previously
deprecated public APIs.
 Internet Explorer: 9+
 Chrome, Edge, Firefox, Safari
 Opera: Current
 Safari Mobile iOS: 7+
 Android 4.0+
 Breaking change: This change may affect existing
code
 Feature: The change is an API addition and should
not affect existing code in most cases.
 Deprecated: This feature or API is still present in
jQuery 3.0, but its use is discouraged. It may be
removed in a future major-version update.
 Special-case Deferred methods removed from
jQuery.ajax
success, error, and complete  done, fail, and always
 Deprecated .size() removed
.size() is deprecated as of jQuery 1.8 and removed in jQuery 3.0 in favor of
the .length property.
 .width(), .height(), .css(“width”), and
.css(“height”) to return decimal values
(whenever the browser does)
Previously, jQuery rounded values when retrieving width and height.
 .outerWidth() or .outerHeight() on window
includes scrollbar width/height
 .show(), .hide(), and .toggle() methods now
respect more stylesheet changes
 Behavior of :hidden and :visible
An element is considered now visible if it has a layout box returned from the
DOM getClientRects() method, even if that box has a height and/or width of
zero. This means that elements such as <br /> or an empty <span> element
that don't have height are considered to be visible.
 New signature for jQuery.get() AND
jQuery.post()
jQuery 3 adds a new signature for the jQuery.get() and
the jQuery.post() functions by adding a settings parameter.
 jQuery.ready promise is formally supported
$.when( $.ready, $.getScript("optional.js") ).then(function() {
// the document is ready and optional.js has loaded/run
}).catch( function() {
// an error occurred
});
 Animations now use requestAnimationFrame
On platforms that support the requestAnimationFrame API, which is pretty
much everywhere, jQuery will now use that API when performing animations.
This should result in animations that are smoother and use less CPU time—
and save battery as well on mobile devices.
 .toggleClass() with no arguments
and .toggleClass( Boolean )
 jQuery.parseJSON()
Since all the browsers supported by jQuery 3.0 support the
native JSON.parse() method, we are
deprecating jQuery.parseJSON().
 document-ready handlers other
than jQuery(function)
Use $(function(){}) instead of $(document).ready(function(){})
 .bind() and .unbind()
Use .on() and off() instead of .bind(), .unbind()
 https://jquery.com/upgrade-guide/3.0/
Osama Abu Quboh
Sr. Front End Engineer
Osa_aq@yahoo.com
Bayt.com

jQuery 3 main changes

  • 1.
    Osama Abu Quboh Sr.Front End Engineer @osa_aq Bayt.com
  • 2.
    With the majorversion of 3.0, the jQuery Core team has taken the opportunity to make changes to clean up the API and fix bugs that may prove to be breaking changes for some code. This includes the removal of previously deprecated public APIs.
  • 3.
     Internet Explorer:9+  Chrome, Edge, Firefox, Safari  Opera: Current  Safari Mobile iOS: 7+  Android 4.0+
  • 4.
     Breaking change:This change may affect existing code  Feature: The change is an API addition and should not affect existing code in most cases.  Deprecated: This feature or API is still present in jQuery 3.0, but its use is discouraged. It may be removed in a future major-version update.
  • 5.
     Special-case Deferredmethods removed from jQuery.ajax success, error, and complete  done, fail, and always  Deprecated .size() removed .size() is deprecated as of jQuery 1.8 and removed in jQuery 3.0 in favor of the .length property.
  • 6.
     .width(), .height(),.css(“width”), and .css(“height”) to return decimal values (whenever the browser does) Previously, jQuery rounded values when retrieving width and height.  .outerWidth() or .outerHeight() on window includes scrollbar width/height
  • 7.
     .show(), .hide(),and .toggle() methods now respect more stylesheet changes  Behavior of :hidden and :visible An element is considered now visible if it has a layout box returned from the DOM getClientRects() method, even if that box has a height and/or width of zero. This means that elements such as <br /> or an empty <span> element that don't have height are considered to be visible.
  • 8.
     New signaturefor jQuery.get() AND jQuery.post() jQuery 3 adds a new signature for the jQuery.get() and the jQuery.post() functions by adding a settings parameter.  jQuery.ready promise is formally supported $.when( $.ready, $.getScript("optional.js") ).then(function() { // the document is ready and optional.js has loaded/run }).catch( function() { // an error occurred });
  • 9.
     Animations nowuse requestAnimationFrame On platforms that support the requestAnimationFrame API, which is pretty much everywhere, jQuery will now use that API when performing animations. This should result in animations that are smoother and use less CPU time— and save battery as well on mobile devices.
  • 10.
     .toggleClass() withno arguments and .toggleClass( Boolean )  jQuery.parseJSON() Since all the browsers supported by jQuery 3.0 support the native JSON.parse() method, we are deprecating jQuery.parseJSON().
  • 11.
     document-ready handlersother than jQuery(function) Use $(function(){}) instead of $(document).ready(function(){})  .bind() and .unbind() Use .on() and off() instead of .bind(), .unbind()
  • 12.
     https://jquery.com/upgrade-guide/3.0/ Osama AbuQuboh Sr. Front End Engineer Osa_aq@yahoo.com Bayt.com