title: Using XMLHttpRequest, reading XML data
body: <p>i am trying to read the xml file but somehow i am getting this error: Invalid number of parameters.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
  //&lt;![CDATA[ 
      if (window.XMLHttpRequest) { 
          // code for IE7+, Firefox, Chrome, Opera, Safari 
          xmlhttp = new XMLHttpRequest(); 
      } 
      else { 
          // code for IE6, IE5 
          xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
      } 
      xmlhttp.open("GET", "employee.XML", false); 
      xmlhttp.send(); 
      xmlDoc = xmlhttp.responseXML; 
  
      var empid= xmlDoc.getElementsByTagName("empid"); 
      var total = placeMarks.length; 
      var names = xmlDoc.getElementsByTagName("Name"); 
      var designation= xmlDoc.getElementsByTagName("designation"); 
      var phone= xmlDoc.getElementsByTagName("phone"); 
      ..... 
  &lt;/script&gt; 
  </code></pre>
  
  <p>XML data:</p>
  
  <pre><code>&lt;employee&gt;
  &lt;emp id="1007"&gt;
  &lt;name&gt;John Chamber&lt;/name&gt;
  &lt;designation&gt;Web Expert1&lt;/designation&gt;
  &lt;phone&gt;555-55-555&lt;/phone&gt;
  &lt;name&gt;John D&lt;/name&gt;
  &lt;designation&gt;Web123123&lt;/designation&gt;
  &lt;phone&gt;555-55-555&lt;/phone&gt;
  &lt;name&gt;Chamber&lt;/name&gt;
  &lt;designation&gt;Web Expert&lt;/designation&gt;
  &lt;phone&gt;555-55-555&lt;/phone&gt;
  &lt;name&gt;Thomas&lt;/name&gt;
  &lt;designation&gt;TESTTEST&lt;/designation&gt;
  &lt;phone&gt;555-55-555&lt;/phone&gt;
  
  &lt;/emp&gt;
  &lt;/employee&gt;
  </code></pre>