First commit

This commit is contained in:
Steven Frank committed 2013-03-11 22:31:03 -07:00
1 parent c518a13178
commit 997ca7b29f
3 files changed
+50

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
walk(document.body);
function walk(node)
{
// I stole this function from here:
// http://is.gd/mwZp7E
var child, next;
switch ( node.nodeType )
{
case 1: // Element
case 9: // Document
case 11: // Document fragment
child = node.firstChild;
while ( child )
{
next = child.nextSibling;
walk(child);
child = next;
}
break;
case 3: // Text node
handleText(node);
break;
}
}
function handleText(textNode)
{
textNode.nodeValue = textNode.nodeValue.replace(/\bthe cloud\b/gi, "my butt");
}