WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Iterate through nodes in xLoadTree, or open_by_id(), John Drago, September 2, 2003
     Re:Iterate through nodes in xLoadTree, or open_by_id(), Erik Arvidsson, September 2, 2003

Subject: Re:Iterate through nodes in xLoadTree, or open_by_id() From: Erik Arvidsson Date: September 2, 2003
The best way is to loop over the childNodes array.

function findNode(node) {
if ( someTest(node) )
return node;
var tmp;
for (var i = 0; i < node.childNodes.length; i++) {
tmp = findNode(node.childNodes[i]);
if (tmp)
return tmp;
}
return null;
}

The ids are pretty much useless in XLoadTree as it is now.

erik



Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX