Original Post
[SOLVED]
Hey.
I have to write a script that can take -any- page and modify -all- of the text based on the text's individual character values.
I have no background in javascript, but I'm stuck with it for this project, and I've never written an algorithm to work through a tree structure, so I don't know whether my error is because my syntax, my algorithm, or my usage of HTML DOM, but I'd really appreciate if someone could help.
[Edited by - jmpeer on July 1, 2010 12:21:31 AM]
Hey.
I have to write a script that can take -any- page and modify -all- of the text based on the text's individual character values.
I have no background in javascript, but I'm stuck with it for this project, and I've never written an algorithm to work through a tree structure, so I don't know whether my error is because my syntax, my algorithm, or my usage of HTML DOM, but I'd really appreciate if someone could help.
var Node = document.documentElement;while(Node.hasChildNodes()){ Node = Node.firstChild;}while(Node != document.documentElement){ while(Node != NULL) { if(Node.nodeType == 3) { //pass the nodeValue to other function } Node = Node.nextSibling; if(Node != NULL) { while(Node.hasChildNodes()) { Node = Node.firstChild; } } } Node = Node.previousSibling; Node = Node.parentNode;}alert("finished");[Edited by - jmpeer on July 1, 2010 12:21:31 AM]