Hi,
The following code works fine in IE7 but FF returns with an error:
Access denied to achieve the property Element.firstCh ild. In this
line:
nodes = xmlDoc.document Element.childNo des;
My code:
function CheckNick()
{
nick = document.getEle mentById("nick" );
nickName = nick.value;
if (window.ActiveX Object)
{
xmlDoc = new ActiveXObject(" Microsoft.XMLDO M");
xmlDoc.onreadys tatechange = function () {
if (xmlDoc.readySt ate == 4) handleXML()
};
xmlDoc.load("is NickAvailable.p hp?nick="+nickN ame+"&IEHACK="+ (new
Date()).getTime ());
}
else if (document.imple mentation &&
document.implem entation.create Document)
{
xmlDoc = document.implem entation.create Document("", "", null);
xmlDoc.onload = handleXML;
xmlDoc.load("is NickAvailable.p hp?nick="+nickN ame+"&IEHACK="+ (new
Date()).getTime ());
}
else
{
alert('Your browser can\'t handle this script');
return;
}
}
function handleXML()
{
nodes = xmlDoc.document Element.childNo des;
alert(nodes.ite m(0).text);
//
alert(xmlDoc.ge tElementsByTagN ame('nick').chi ldNodes.firstCh ild.nodeValue);
}
Regards
Hush
The following code works fine in IE7 but FF returns with an error:
Access denied to achieve the property Element.firstCh ild. In this
line:
nodes = xmlDoc.document Element.childNo des;
My code:
function CheckNick()
{
nick = document.getEle mentById("nick" );
nickName = nick.value;
if (window.ActiveX Object)
{
xmlDoc = new ActiveXObject(" Microsoft.XMLDO M");
xmlDoc.onreadys tatechange = function () {
if (xmlDoc.readySt ate == 4) handleXML()
};
xmlDoc.load("is NickAvailable.p hp?nick="+nickN ame+"&IEHACK="+ (new
Date()).getTime ());
}
else if (document.imple mentation &&
document.implem entation.create Document)
{
xmlDoc = document.implem entation.create Document("", "", null);
xmlDoc.onload = handleXML;
xmlDoc.load("is NickAvailable.p hp?nick="+nickN ame+"&IEHACK="+ (new
Date()).getTime ());
}
else
{
alert('Your browser can\'t handle this script');
return;
}
}
function handleXML()
{
nodes = xmlDoc.document Element.childNo des;
alert(nodes.ite m(0).text);
//
alert(xmlDoc.ge tElementsByTagN ame('nick').chi ldNodes.firstCh ild.nodeValue);
}
Regards
Hush
Comment