[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 7024
  • Last Modified:

Loading XML In Google Chrome

Experts, I'm using the following code to load an XML document. This works in IE and FireFox but not in Google Chrome. Is there something I'm missing?
function importXML()
{
    nav = document.getElementById("nav");
    
    if (document.implementation && document.implementation.createDocument)
    {
        xmlDoc = document.implementation.createDocument("", "", null);
        xmlDoc.onload = nav_create;
    }
    else if (window.ActiveXObject)
    {
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.onreadystatechange = function () {
	        if (xmlDoc.readyState == 4) nav_create()
        };
    }
    else
    {
        alert('Your browser can\'t handle this script');
        return;
    }
    xmlDoc.load("AdministrationSiteMap.aspx");
}

Open in new window

0
clickclickbang
Asked:
clickclickbang
  • 2
1 Solution
 
Xyptilon2Commented:
Chrome does not render xml documents, however if you do a "view page source" you can see the xml
0
 
clickclickbangAuthor Commented:
I need to load the document via JavaScript. I don't need to "view page source" to see XML.
0
 
clickclickbangAuthor Commented:
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now