Created
May 31, 2012 18:21
-
-
Save joshpangell/2845221 to your computer and use it in GitHub Desktop.
Test browser for SVG/VML support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function supportsSvg() { | |
return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape", "1.0") | |
} | |
function supportsVml() { | |
if (typeof supportsVml.supported == "undefined") { | |
var a = document.body.appendChild(document.createElement('div')); | |
a.innerHTML = '<v:shape id="vml_flag1" adj="1" />'; | |
var b = a.firstChild; | |
b.style.behavior = "url(#default#VML)"; | |
supportsVml.supported = b ? typeof b.adj == "object": true; | |
a.parentNode.removeChild(a); | |
} | |
return supportsVml.supported | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment