Learn what is a polyfill and some use cases.

A polyfill, is basically code (most of the cases a plugin) that provides the technology that the developer, expect the browser to provide natively but for some Internet Explorer reason, it doesn't. Overriding if you want, the native functionality if it is already supported.

A polyfill is not part of the HTML5 Standard. Nor is a polyfill limited to Javascript, even though you often see polyfills being referred to in those contexts.

Polyfill examples

ExplorerCanvas

As you may know, IE8 or previous versions doesn't support canvas feature ! Explorer Canvas allow you to use canvas in ie as you may use it with a modern browser.

If there's no native canvas, we can provide canvas support using Silverlight. If Silverlight isn't available, the plugin use VML(Vector Markup Language). Using excanvas provides the developer with a solid canvas backup replacement in old environments.

Web Storage (LocalStorage and SessionStorage)

These libraries uses fallbacks for localStorage and sessionStorage (for example using cookies).

You can read here a really extense collection of polyfills for HTML5 which can be useful for you someday.


Senior Software Engineer at Software Medico. Interested in programming since he was 14 years old, Carlos is a self-taught programmer and founder and author of most of the articles at Our Code World.

Sponsors