Introduction to Polyfill

1. What is Polyfill?

PolyfillIt is a jslibrary that mainly smoothes the differences in js implementation between different browsers. For example, html5the storage( session, local), different browsers, different versions, some support, some do not support. Polyfill( PolyfillThere are many, GitHubon https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills ) to help you smooth out these differences, and those that are not supported become supported (typically in window.XMLHttpRequest is added in IE browser, and ActiveXObject is used for internal implementation.)

Mention Polyfill, have to mention shim, polyfillis shima kind of.
shimIs to apiencapsulate into one, such as jQuerythe $.ajaxencapsulation of andXMLHttpRequest to create objects in a way. It introduces a new one into an old environment, and implements it only by the means already in the old environment.IEActiveXObjectxhrAPI

2. How to use?

Directly import the project, the easiest is CDN:

<script src="//cdn.polyfill.io/v1/polyfill.min.js" async defer></script>

Brief book synchronization article

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325523221&siteId=291194637