stevecrozz
IS-IT--Management
I'm loading an XML file in mozilla here:
if (document.implementation && document.implementation.createDocument)
{
xmlDoc = document.implementation.createDocument("", "", null);
xmlDoc.onload = fillArrayMoz;
}
fillArrayMoz() contains a number of new object declarations that look like: feeds[1][writePos] = new news()
This creates new news objects inside my function, and it does work this far. It loads an XML file, parses the data into an array and I am able to window.alert(feeds[1][0].propertyA) and get the contents of that object property.
But, outside fillArrayMoz() the new objects cease to exist, even though their container array is global. How do I declare these objects to be global? or how do I return all these objects back through the function loading the XML file?
if (document.implementation && document.implementation.createDocument)
{
xmlDoc = document.implementation.createDocument("", "", null);
xmlDoc.onload = fillArrayMoz;
}
fillArrayMoz() contains a number of new object declarations that look like: feeds[1][writePos] = new news()
This creates new news objects inside my function, and it does work this far. It loads an XML file, parses the data into an array and I am able to window.alert(feeds[1][0].propertyA) and get the contents of that object property.
But, outside fillArrayMoz() the new objects cease to exist, even though their container array is global. How do I declare these objects to be global? or how do I return all these objects back through the function loading the XML file?