Using Modernizr to detect HTML5 features and provide fallbacks. Modernizr is a JavaScript library that detects which HTML5 and CSS3 features your visitor’s browser supports.
In detecting feature support, it allows developers to test for some of the new technologies and then provide fallbacks for browsers that do not support them. This is called feature detection. Modernizr: the feature detection library for HTML5/CSS3. And Content Delivery Networks (CDNs) One of the most common requests around Modernizr is for it to be made available on a Content Delivery Network.
Back in the 1.x days this made a fair bit of sense: there was only one version of the library, and so the compressed version would be useful to have on a CDN for performance reasons. With the advent of Modernizr 2, however we’ve (re)introduced modular builds of the library, which make the value of CDNs less self-evident. We now make you create a customized build of Modernizr—using only the tests you actually need—when you want a production-ready, minified & compressed version of the library. But with over 40 embedded tests, supporting all possible combinations of tests is impossible, aside of being downright undesirable. This has caused some confusion, so we’d like to explain the right way to use Modernizr under the various different scenarios that occur.