title: Reading xml file using javascript
body: <p>I am using the below code to read one xml file which is located locally. But its not displaying the object of xmldoc. My code is</p>
  
  <pre><code>function loadXMLDoc(XMLname)
  {
    var xmlDoc;
    if (window.XMLHttpRequest)
      {
      xmlDoc=new window.XMLHttpRequest();
      xmlDoc.open("GET",XMLname,false);
       xmlDoc.send("");
       return xmlDoc.responseXML;
     }
  
     else if (ActiveXObject("Microsoft.XMLDOM"))
     {
     xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
      xmlDoc.async=false;
     xmlDoc.load(XMLname);
     return xmlDoc;
     }
     alert("Error loading document!");
     return null;
     }
  
  
  
     function f1()
     {
     var xmlDoc=loadXMLDoc(“test.xml”)
     var M = xmlDoc.getElementsByTagName(“article”);
     alert(M);
       }
  </code></pre>
  
  <p>Its not displaying the alert if i call the function f1.Thanks in advance</p>