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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.