title: ERROR in handling Multiple AJAX request on a page
body: <pre><code>&lt;script type="text/javascript"&gt;
      function loadXMLDoc() {
          var xmlhttp;
          var k = document.getElementById("usernamesignup").value;
          var urls = "AJAX.jsp?ver=" + k;
  
          if (window.XMLHttpRequest) {
              xmlhttp = new XMLHttpRequest();
          } else {
              xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          }
          xmlhttp.onreadystatechange = function () {
              if (xmlhttp.readyState == 4) {
                  //document.getElementById("err").style.color="red";
                  document.getElementById("err").innerHTML = xmlhttp.responseText;
  
              }
          }
          xmlhttp.open("GET", urls, true);
          xmlhttp.send();
      }
  
      function loadXMLDoc1() {
          var xmlhttp;
          var k1 = document.getElementById("emailsignup").value;
          var urls1 = "AJAX1.jsp?ver1=" + k1;
  
          if (window.XMLHttpRequest) {
              xmlhttp = new XMLHttpRequest();
          } else {
              xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          }
          xmlhttp.onreadystatechange = function () {
              if (xmlhttp.readyState == 4) {
                  //document.getElementById("err1").style.color="red";
                  document.getElementById("err1").innerHTML = xmlhttp.responseText;
  
              }
          }
          xmlhttp.open("GET", urls1, true);
          xmlhttp.send();
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>here is AJAX.jsp--<a href="http://jsfiddle.net/NZhXn/" rel="nofollow">AJAX.jsp</a></p>
  
  <p>and here is AJAX1.jsp--<a href="http://jsfiddle.net/rNP85/" rel="nofollow">AJAX1.jsp</a></p>
  
  <p>The first function - <code>loadXMLDoc()</code> checks from the Database about username availability using <code>AJAX.jsp</code> and returns the message string accordingly.</p>
  
  <p>The second function - <code>loadXMLDoc1()</code> intends to do the same thing with the email, but doesn't return any messages as it does while checking the <code>USERNAME</code>. </p>
  
  <p>Is there a problem with the code??? Whats the solution....
  Thanks</p>