Home > Web Front-end > H5 Tutorial > body text

shim和polyfill有什么区别?

WBOY
Release: 2016-06-07 08:44:01
Original
1666 people have browsed it

回复内容:

图灵社区 : 阅读 : HTML5逸事:一袋“腻子粉”的故事(待续) polyfill 是 shim 的一种。

shim 是将不同 api 封装成一种,比如 jQuery 的 $.ajax 封装了 XMLHttpRequest 和 IE 用 ActiveXObject 方式创建 xhr 对象;

polyfill 特指 shim 成的 api 是遵循标准的,其典型做法是在IE浏览器中增加 window.XMLHttpRequest ,内部实现使用 ActiveXObject。

在实际中为了方便做对比,会特指 shim 的 api 不是遵循标准的,而是自己设计的。
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!