ok, so here is the code im using:
Code:
function getmessage()
{
//Get list of definition tags
var glossary = xmlDoc.getElementsByTagName('definition');
//Elements plaecholder
var elements = new Array();
//document.write(glossary.length); //Test length of glossary in words
//Using length of glossary, put information into elements placeholder
for (i=0;i<glossary.length;i++)
{
// Get words and put them into first element of array
var word_length = xmlDoc.getElementsByTagName("word");
var word = word_length[i].childNodes[0].nodeValue;
//document.write(word);
elements[i] = new Array(word);
// document.write(elements[i][0]);
//Get sections and put them into the second element of array
var section_length = xmlDoc.getElementsByTagName("section");
var section = section_length[i].childNodes[0].nodeValue;
elements[i][1] = section;
//Get definitions and put them into third element of array
var def_length = xmlDoc.getElementsByTagName("def");
var def = def_length[i].childNodes[0].nodeValue;
elements[i][2] = def;
document.write(elements[i][0]);
document.write("<br>");
document.write(elements[i][1]);
document.write("<br>");
document.write(elements[i][2]);
document.write("<br>");
}
// Rest of code is after this
The problem I run into is this: It does exactly what I want it to do, stores the data to an array and prints it exactly how I want it, however it does not seem to either exit the for loop or something weird, as the rest of the script will not run, and in firefox it prints my dad then sits there saying "Loading..." with the circle spinning.
When i comment out that entire for loop the rest of the script will run, so I have to assume it has something to do with that. Anyone have any suggestions?