HTML5中polyfills的含义是什么? [英] What is the meaning of polyfills in HTML5?

查看:140
本文介绍了HTML5中polyfills的含义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML5中的polyfills的含义是什么?我在很多关于HTML5的网站中看到了这个词,例如 HTML5-Cross-Browser-Polyfills。


因此,我们正在收集所有垫片,回退以及polyfill
,以便在不包含$ b $的浏览器中植入HTML5功能b本地支持它们。

实际上我不明白polyfills是什么意思。



它是一种新的HTML5技术或JavaScript库吗?在HTML5之前,我从来没有听说过这个词。



垫片,后备和polyfill之间有什么区别?

解决方案

polyfill是一种浏览器后备,使用JavaScript编写,允许您在现代浏览器中使用的功能可以在旧版浏览器中使用,例如,在旧版本中支持canvas(HTML5功能)浏览器。

这是一种HTML5技术,因为它与HTML5结合使用,但它不是HTML5的一部分,并且可以在没有HTML5的情况下使用polyfills例如,要支持你想要的CSS3技术)。



这是一篇不错的文章:

http://remysharp.com/2010/10/08/what-is-a-polyfill/

以下是Polyfill和Shims的完整列表:

https://github.com/Modernizr/Modernizr/w iki / HTML5-跨浏览器 - Polyfills


What is the meaning of polyfills in HTML5? I saw this word in many sites about HTML5, e.g. HTML5-Cross-Browser-Polyfills.

So here we're collecting all the shims, fallbacks, and polyfills in order to implant HTML5 functionality in browsers that don't natively support them.

I actually don't understood what is the meaning of polyfills.

Is it a new HTML5 technique or a JavaScript library? I never heard this word before HTML5.

And what is the difference between shims, fallbacks, and polyfills?

解决方案

A polyfill is a browser fallback, made in JavaScript, that allows functionality you expect to work in modern browsers to work in older browsers, e.g., to support canvas (an HTML5 feature) in older browsers.

It's sort of an HTML5 technique, since it is used in conjunction with HTML5, but it's not part of HTML5, and you can have polyfills without having HTML5 (for example, to support CSS3 techniques you want).

Here's a good post:

http://remysharp.com/2010/10/08/what-is-a-polyfill/

Here's a comprehensive list of Polyfills and Shims:

https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills

这篇关于HTML5中polyfills的含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆