Created
March 9, 2016 18:35
-
-
Save Vesely/75a0cfeefb3a475d9867 to your computer and use it in GitHub Desktop.
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> | |
if (!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1")) { | |
var imgs = document.getElementsByTagName('img'); | |
var endsWithDotSvg = /.*\.svg$/ | |
var i = 0; | |
var l = imgs.length; | |
for(; i != l; ++i) { | |
if(imgs[i].src.match(endsWithDotSvg)) { | |
imgs[i].src = imgs[i].src.slice(0, -3) + 'png'; | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment