title: Read XML file using JavaScript in Chrome
body: <p>I need to load and read an XML file using JavaScript.</p>
  
  <p>The following code works fine in Firefox, IE and Opera:</p>
  
  <pre class="lang-js prettyprint-override"><code>function loadXMLDoc(dname) {
    var xmlDoc
  
    // Internet Explorer
    try {
      xmlDoc = new ActiveXObject('Microsoft.XMLDOM')
    }
    catch (e) {
      // Firefox, Opera, etc.
      try {
        xmlDoc = document.implementation.createDocument('', '', null)
      }
      catch (e) {
        alert(e.message)
      }
    }
  
    try {
      xmlDoc.async = false
      xmlDoc.load(dname)
      return xmlDoc
    }
    catch (e) {
      alert(e.message)
    }
  
    return null
  }
  </code></pre>
  
  <p>But executing this code in Chrome gives me this error:</p>
  
  <blockquote>
    <p>Object# has no method "load"</p>
  </blockquote>