Created
April 5, 2014 16:05
-
-
Save rutger1140/9993776 to your computer and use it in GitHub Desktop.
Check for JS and SVG support and add/remove HTML classes accordingly. Snippet used in <head>
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
<script> | |
// Check for javascript support | |
(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement); | |
// Check for SVG support | |
(function(H){if(!!("createElementNS"in document&&document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect)){H.className+=" svg"}else{H.className+=" no-svg"}})(document.documentElement); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment