HOW TO READ XML FILE IN JAVASCRIPT?

Vikas Giri

Total Post:13

Points:91
Posted by  Vikas Giri
 4315  View(s)
Ratings:
Rate this:
How to read xml file in javascript?
Please give the syntax
Thanks in advance.
  1. Amit Singh

    Post:103

    Points:721
    Re: How to read XML file in javascript?

    Read XML file in javascript
    Syntax:
     //Retrieving a XML file in IE5
        var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.load("xmlfile.xml");

        //Cross browser XML file retrieval
        if (window.ActiveXObject)
            var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        else if (document.implementation && document.implementation.createDocument)
            var xmlDoc = document.implementation.createDocument("", "doc", null);
        xmlDoc.load("xmlfile.xml");

    use this syntax to load the xml file

      Modified On Apr-28-2011 01:43:23 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!