modernizr
Version:
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
26 lines (23 loc) • 606 B
JavaScript
/*!
{
"name": "Inline SVG",
"property": "inlinesvg",
"caniuse": "svg-html5",
"tags": ["svg"],
"notes": [{
"name": "Test page",
"href": "http://paulirish.com/demo/inline-svg"
}],
"polyfills": ["inline-svg-polyfill"]
}
!*/
/* DOC
Detects support for inline SVG in HTML (not within XHTML).
*/
define(['Modernizr', 'createElement'], function( Modernizr, createElement ) {
Modernizr.addTest('inlinesvg', function() {
var div = createElement('div');
div.innerHTML = '<svg/>';
return (div.firstChild && div.firstChild.namespaceURI) == 'http://www.w3.org/2000/svg';
});
});