Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
490 views
in Technique[技术] by (71.8m points)

javascript - HTML5中polyfills的含义是什么?(What is the meaning of polyfills in HTML5?)

What is the meaning of polyfills in HTML5?

(HTML5中polyfills的含义是什么?)

I saw this word in many sites about HTML5, eg HTML5-Cross-Browser-Polyfills.

(我在许多网站上看到过关于HTML5的这个词,例如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.

(所以我们在这里收集所有垫片,后备和polyfill,以便在本身不支持它们的浏览器中植入HTML5功能。)

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

(我其实不明白polyfills是什么意思。)

Is it a new HTML5 technique or a JavaScript library?

(它是一种新的HTML5技术还是JavaScript库?)

I never heard this word before HTML5.

(我从来没有在HTML5之前听过这个词。)

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

(垫片,后备和填充物之间有什么区别?)

  ask by Jitendra Vyas translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

(polyfill是一种浏览器后备,由JavaScript构建,允许您希望在现代浏览器中工作的功能在旧版浏览器中工作,例如,支持旧版浏览器中的canvas(HTML5功能)。)

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).

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

Here's a good post:

(这是一篇好文章:)

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

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

Here's a comprehensive list of Polyfills and Shims:

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

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...