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

LVL 1
clickclickbangAsked:
Who is Participating?
 
clickclickbangConnect With a Mentor Author Commented:
0
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.