title: TypeError: Value undefined (result of expression xmlDoc.load) is not object
body: <p>I am trying to load an XML file using Javascript and I have yet to find a good function that works in IE, Firefox, and Safari. The load function I am currently using is basically the one straight out of the w3schools tutorials:</p>
  
  <p><a href="http://www.w3schools.com/XML/tryit.asp?filename=tryxml_dom_createelement" rel="nofollow noreferrer">http://www.w3schools.com/XML/tryit.asp?filename=tryxml_dom_createelement</a></p>
  
  <p>The exact code looks like: </p>
  
  <pre><code>if (window.ActiveXObject)
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  }
  // code for Mozilla, Firefox, Opera, etc.
  else if (document.implementation.createDocument)
  {
  xmlDoc=document.implementation.createDocument("","",null);
  }
  else
  {
  alert('Your browser cannot handle this script');
  }
  xmlDoc.async=false;
  xmlDoc.load(dname);
  </code></pre>
  
  <p>Where dname = the url of the xml file. This code gets a "TypeError: Value undefined (result of expression xmlDoc.load) is not object." in Safari.</p>
  
  <p>I have also tried the code on this site:</p>
  
  <p><a href="http://developer.apple.com/internet/webcontent/xmlhttpreq.html" rel="nofollow noreferrer">http://developer.apple.com/internet/webcontent/xmlhttpreq.html</a></p>
  
  <p>However, it yields a null XML file. Can anyone help?</p>