Skip to content

Instantly share code, notes, and snippets.

@nola
Created September 21, 2015 20:16
Show Gist options
  • Save nola/34ee5a53cb05a23b49f1 to your computer and use it in GitHub Desktop.
Save nola/34ee5a53cb05a23b49f1 to your computer and use it in GitHub Desktop.
if (!Modernizr.svg) {
var imgs = document.getElementsByTagName('img');
var svgExtension = /.*\.svg$/
var l = imgs.length;
for(var i = 0; i < l; i++) {
if(imgs[i].src.match(svgExtension)) {
imgs[i].src = imgs[i].src.slice(0, -3) + 'png';
//console.log(imgs[i].src);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment