Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Vesely/75a0cfeefb3a475d9867 to your computer and use it in GitHub Desktop.
Save Vesely/75a0cfeefb3a475d9867 to your computer and use it in GitHub Desktop.
<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