I have an AJAX application using which im attempting to acces a #Text node in the NAME tag of an XML document. i then want to sort the names and place them into tables <td> tag. i can put the names in the <td> but i want them sorted alphabeticaly.
from my understanding im suppose to be able to sort an array simply like this Array[].sort();…………..this is the reason i need the text to be an array. Unless you know a simpler way to do this.
[CODE]
function postNames(){
var signersdoc = xmlHttp.responseXML;
var container = document.getElementsByTagName(“td”);
var data = signersdoc.getElementsByTagName(“Names”);
for ( var j = 0; j < container.length && j < data.length; j++) {
var key = container[j].firstChild.nodeValue;
var name = data[j].firstChild.nodeValue;
key = name;
}
}
<DOC>
<NAME>uknowmeim</NAME>
<NAME>bob</NAME>
<NAME>jANE</NAME>
</DOC>
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>