I have these functions:
==========================
=========
function LoadXMLFile(sURL) {
var oXML;
try {
oXML = new ActiveXObject('Msxml2.DOMD
ocument');
} catch(e) {oXML = false;}
if(oXML) {
//IE load XML document
oXML.async = false;
oXML.load(sURL);
if(oXML.parseError.errorCo
de) {
alert('error: ' + oXML.parseError.descriptio
n);
return false;
}
}
if(!oXML) {
//Mozilla load XML document
try {
oXML = document.implementation.cr
eateDocume
nt("", "", null);
} catch(e) {oXML = false;}
if(oXML) {
try {
oXML.load(sURL);
} catch(e) {oXML = false;}
}
}
return oXML;
}
function ConfirmTask(iTaskId, iPersonId, oCheckbox) {
var bChecked = oCheckbox.checked;
var sURL = '../rooster/ConfirmPersonP
lanning.as
p?task_id=
'+iTaskId+
'&person_i
d='+iPerso
nId+'&conf
irm='+bChe
cked;
var oXML = LoadXMLFile(sURL);
if(oXML) {
var sResult = parseInt(oXML.firstChild.t
ext); // <<====== here is the line with the error
alert(sResult);
if(!sResult) {
oCheckbox.checked = !oCheckbox.checked;
alert('it did not work');
} else {
alert('ok');
}
} else {
oCheckbox.checked = !oCheckbox.checked;
alert('no support for this');
}
return false;
}
=======================
It works fine in IE, but Firebird (0.8) returns an error
oXML.firstChild.text has no properties. Apparently something goes wrong the loading the XML. I looked at a lot of documentation, but i could not find a solution.
How can i make the thing work in Mozilla ??
Start Free Trial