Created
August 27, 2014 20:54
-
-
Save AABoyles/b9770083f74f3078760d to your computer and use it in GitHub Desktop.
FunkyStats
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
function htmlreplace(element){ | |
var nodes=element.childNodes; | |
for(var n=0;n<nodes.length;n++){ | |
if(nodes[n].nodeType==3){ | |
var r=new RegExp('[pP][^A-Za-z0-9]+[vV]alue', 'gi'); | |
if(nodes[n].textContent){ | |
nodes[n].nodeValue=nodes[n].textContent.replace(r,'P. Funk'); | |
}else{ | |
nodes[n].nodeValue=nodes[n].nodeValue.replace(r,'P. Funk'); | |
} | |
}else{ | |
htmlreplace(nodes[n]); | |
} | |
} | |
} | |
htmlreplace(document.body); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment