Jump to content

Firefox hasChildNodes returning false


BlackenedSky

Recommended Posts

Hi,

 

I'm trying to load in an XML document, but for some reason whenever I try, it says that there are no childNodes.

 

Here is the code:

loadXmlDoc(file) {

if (window.ActiveXObject) {

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

xmlDoc.async=false;

xmlDoc.load(file);

initBoxes(xmlDoc);

} else if (document.implementation && document.implementation.createDocument) {

var xmlDoc=document.implementation.createDocument("","",null);

xmlDoc.load(file);

xmlDoc.onload=alert(xmlDoc.hasChildNodes());//initBoxes(xmlDoc);

}

}

 

This function works fine in IE, but now I am around to testing in firefox and it refuses to work. XML file has correct formatting etc, and firefox displays it no problem using a direct link.

 

Any ideas why it isn't loading the document?

 

Cheers!

Link to comment
https://forums.phpfreaks.com/topic/44581-firefox-haschildnodes-returning-false/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.