title: Javascript XML parsing not working
body: <p>I'm nearing my wits' end here on what should be a simple problem. I'm trying to use javascript to parse and return values from a very simple XML document to a very simple HTML document. My problem is that my script refuses to do this.
  The XML: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;root&gt;
  &lt;man&gt;
    &lt;name&gt;Nicholas&lt;/name&gt;
  &lt;/man&gt;
  &lt;man&gt;
    &lt;name&gt;Peter&lt;/name&gt;
  &lt;/man&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>This is strictly for my own education, hence the purposeless tags.</p>
  
  <p>The JavaScript:</p>
  
  <pre><code>&lt;script&gt;
  function loadXMLDoc(dname)
  {
  if (window.XMLHttpRequest)
    {
    xmlhttp=new XMLHttpRequest();
    }
  else
    {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  xmlhttp.open("GET","dname",false);
  xmlhttp.send();
  return xmlhttp.responseXML; 
  }
  
  xmlDoc =     loadXMLDoc("https://dl.dropboxusercontent.com/u/22818342/Testing/javascript_test4.xml");
  
  x = xmldoc.getElementsByTagName("name");
  
  var content = function()
  {
      document.write(x[0].childNodes[0].nodeValue);
  };
  &lt;/script&gt;
  </code></pre>
  
  <p>Note that I'm using my Dropbox public folder to enable the HTTP-fetching part of the code. All these files are located in the same directory.</p>
  
  <p>The (relevant) HTML:</p>
  
  <pre><code>&lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;link href="https://dl.dropboxusercontent.com/u/22818342/Testing/javascript_test3.css" rel="stylesheet" type="text/css" /&gt;
  &lt;body&gt;
  &lt;button type="button" onclick="content()"&gt;Click Me&lt;/button&gt;
  &lt;body&gt;
  </code></pre>
  
  <p>Also note that when I click the button, ostensibly firing the <code>content()</code> function, nothing happens--it's not a matter of everything being overwritten.</p>
  
  <p>Other relevant information:
  --I'm testing this in Google Chrome
  --I lifted much of this code (again, learning purposes only) from the W3Schools XML-parsing demo and from another StackOverflow post from a user with a similar problem to mine. <em>In both cases</em> the code ran fine; it's only when I attempt to run it that things gum up.
  --I'm fairly new to Javascript and the XML DOM, so it's entirely possible that I made an elementary error somewhere.</p>
  
  <p>I'd appreciate any help the community can provide.</p>