Loading XML In Google Chrome

Posted on 2008-11-17
Last Modified: 2013-11-10
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()





        alert('Your browser can\'t handle this script');





Open in new window

Question by:clickclickbang
    LVL 13

    Expert Comment

    Chrome does not render xml documents, however if you do a "view page source" you can see the xml
    LVL 1

    Author Comment

    I need to load the document via JavaScript. I don't need to "view page source" to see XML.
    LVL 1

    Accepted Solution


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
    #Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
    How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now