BlackenedSky Posted March 28, 2007 Share Posted March 28, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.