User:Jarry1250/svg.js

function swapSVGs{ var links = document.getElementsByTagName("a"); for(a = 0; a < links.length; a++){ link = links[a]; if(link.getAttribute("class") == "image"){ var image = link.getElementsByTagName("img"); image = image[0]; var src = image.getAttribute("src") src = src.split(".svg",2); if(src.length > 1){ src = src[0].replace("thumb/","") + ".svg"; image.setAttribute("src", src); } } } } $(swapSVGs);