Ok, here's my dumbdumb question of the day:
I have this loop that's supposed to loop through the 11 XML elements named
"title" in the object.
When I put a number in the array brackets like this:
tables = response.getElementsByTagName("title");
for(var i = 0;i <= tables.length;i++) {
strTitles = strTitles + tables[1].firstChild.nodeValue+"<br/>";
}
document.getElementById('foo').innerHTML = strTitles;
....I get the appropriate value displayed (albeit 11 times).
But when I try to put in the variable "i", like this:
tables = response.getElementsByTagName("title");
for(var i = 0;i <= tables.length;i++) {
strTitles = strTitles + tables[i].firstChild.nodeValue+"<br/>";
}
document.getElementById('foo').innerHTML = strTitles;
....I get the following error:
Error:tables[i] has no properties?
Any clue why? I'm sure when I hear the answer I'll be kicking myself, but
I have to know. :)
--
[================================================== ===========================]
Sugapablo -> http://www.sugapablo.net
[================================================== ===========================]