I assume that you can check if svg supported, and if you do not scroll the image tags and set their src path to .png . This example has not been tested, but it could be a step in the right direction.
if(!Modernizr.svg){ var images = document.getElementsByTagName("img"); for(var i = 0; i < images.length; i++){ var src = images[i].src.split("."); images[i].src = src[0] + ".png"; } }
If jQuery is an option, maybe something like this:
if(!Modernizr.svg){ $("img").each(function(){ var src = this.src.split("."); this.src = src[0] + ".png"; }); }
EDIT
You may also consider looking for Modernizr-Server . This way you can test svg while you view the images and add the appropriate extension.
if ($modernizr->svg) { ... } elseif ($modernizr->canvas) { ... }
Chase source share