title: XMLHttpRequest (Ajax) Error
body: <p>I'm using <code>XMLHttpRequest</code> in JavaScript. However, it gives me an error, and I don't know what my problem is.<br>
  I have to parse an XML file and assign its contents to the webpage - here's my code:</p>
  
  <pre><code>&lt;script = "text/javascript"&gt;
  
      window.onload = onPageLoad();
      var questionNum = 0;
  
      function onPageLoad(questionNum) {
          var xmlhttp = new XMLHttpRequest();
          xmlhttp.open("GET","quiz.xml");
          try {
              xmlhttp.send(null); // Here a xmlhttprequestexception number 101 is thrown 
          } catch(err) {
              document.getElementById("body").innerHTML += "\nXMLHttprequest error: " + err.description; // This prints "XMLHttprequest error: undefined" in the body.
          }
          xmlDoc = xmlhttp.responseXML;
          parser = new DOMParser(); // This code is untested as it does not run this far.
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>My XML file is inside the same directory. </p>
  
  <pre><code>&lt;question&gt;
      &lt;query&gt;what is 2+2?&lt;/query&gt;
      &lt;option&gt;4&lt;/option&gt;
      &lt;option&gt;5&lt;/option&gt;
      &lt;option&gt;3&lt;/option&gt;
      &lt;answer&gt;4&lt;/answer&gt;
  &lt;/question&gt;
  </code></pre>
  
  <p>Just for reference, I typically program in C# or Java, and I'm running my website on Google Chrome.</p>