Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning jQuery 3 - Fifth Edition

You're reading from  Learning jQuery 3 - Fifth Edition

Product type Book
Published in May 2017
Publisher Packt
ISBN-13 9781785882982
Pages 448 pages
Edition 5th Edition
Languages
Authors (2):
Jonathan Chaffer Jonathan Chaffer
Profile icon Jonathan Chaffer
Karl Swedberg Karl Swedberg
Profile icon Karl Swedberg
View More author details
Toc

Table of Contents (23) Chapters close

Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Dedication
Preface
1. Getting Started 2. Selecting Elements 3. Handling Events 4. Styling and Animating 5. Manipulating the DOM 6. Sending Data with Ajax 7. Using Plugins 8. Developing Plugins 9. Advanced Selectors and Traversing 10. Advanced Events 11. Advanced Effects 12. Advanced DOM Manipulation 13. Advanced Ajax 14. Testing JavaScript with QUnit 15. Quick Reference

What's new in jQuery 3?


The changes introduced in jQuery 3 are quite subtle compared to the changes introduced in jQuery 2. Most of what's changed is under the hood. Let's take a brief look at some changes and how they're likely to impact an existing jQuery project. You can review the fine-grained details (https://jquery.com/upgrade-guide/3.0) while reading this book.

Browser support

The biggest change with browser support in jQuery 3 is Internet Explorer. Having to support older versions of this browser is the bane of any web developer's existence. jQuery 3 has taken a big step forward by only supporting IE9+. The support policy for other browsers is the current version and the previous version.

Note

The days of Internet Explorer are numbered. Microsoft has released the successor to IE called Edge. This browser is a completely separate project from IE and isn't burdened by the issues that have plagued IE. Additionally, recent versions of Microsoft Windows actually push for Edge as the default browser, and updates are regular and predictable. Goodbye and good riddance IE.

Deferred objects

The Deferred object was introduced in jQuery 1.5 as a means to better manage asynchronous behavior. They were kind of like ES2015 promises, but different enough that they weren't interchangeable. Now that the ES2015 version of JavaScript is commonplace in modern browsers, the Deferred object is fully compatible with native Promise objects. This means that quite a lot has changed with the old Deferred implementation.

Asynchronous document-ready

The idea that the document-ready callback function is executed asynchronously might seem counterintuitive at first. There are a couple of reasons this is the case in jQuery 3. First, the $(() => {}) expression returns a Deferred instance, and these now behave like native promises. The second reason is that there's a jQuery.ready promise that resolves when the document is ready. As you'll see later on in this book, you can use this promise alongside other promises to perform other asynchronous tasks before the DOM is ready to render.

All the rest

There are a number of other breaking changes to the API that were introduced in jQuery 3 that we won't dwell on here. The upgrade guide that I mentioned earlier goes into detail about each of these changes and how to deal with them. However, I'll point out functionality that's new or different in jQuery 3 as we make our way through this book.

You have been reading a chapter from
Learning jQuery 3 - Fifth Edition
Published in: May 2017 Publisher: Packt ISBN-13: 9781785882982
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime