From the course: JavaScript: Async
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Making code backward-compatible with polyfill - JavaScript Tutorial
From the course: JavaScript: Async
Making code backward-compatible with polyfill
- [Instructor] Promises became part of JavaScript in 2015 and are supported by all modern browsers. However, code that uses promises won't work on older browsers or on Opera Mini. And unlike a lot of other modern JavaScript syntax, promises can't be simply transpired by a tool like Babel. Instead, a number of polyfills are available to replicate promise's syntax on browsers that don't support it natively. This polyfill written by Taylor Hakes makes a minified version available via CDN. So I'm going to copy that. And then in my editor, I'm actually going to work with the HTML file. And in this file, I have my JavaScript files in the head section, and I need to make sure to insert the code for the promises polyfill before the code for my Ajax, which uses it. So I'm going to insert that new script element on the line before the script element that references ajax.js. So I'm going to save that and going back to my browser.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Understanding promises2m 46s
-
(Locked)
Building asynchronous code with promises3m 59s
-
(Locked)
Appending methods to resolved promises2m 38s
-
(Locked)
Using catch methods for rejected promises3m 52s
-
(Locked)
Using the finally method for executing handlers3m 32s
-
(Locked)
Preparing the all method for executing multiple promises2m 16s
-
(Locked)
Implementing the all method for executing multiple promises6m 39s
-
(Locked)
Making code backward-compatible with polyfill1m 29s
-
(Locked)
-
-
-