Ahhh, ok. Interesting. Thanks. I've just knocked this code up, but can't test it right now. I hope it's what you mean, and I'll see if it works later:
Code:
stop();
// create a new XML object
var myPhoneXML = new XML();
//Text nodes that contain only white space are discarded
myPhoneXML.ignoreWhite = true; // define the onload handler
myPhoneXML.onLoad = function(success)
{
if (success) {
//do something
} else {
//do something else
}};
// load the XML file into the myPhoneXML object
myPhoneXML.load("http://www.website.com/whatever.xml");
setInterval(
myPhoneXML.onData = function(src){
if (src == undefined) {
this.onLoad(false);
//did not load ok
} else {
this.parseXML(src);
this.loaded = true;
this.onLoad(true);
//loaded ok - call onload
}
}
,5000);