title: how to abort a xmlhttprequest before starting a new request?
body: <p>I got a cgi-script the performs a search according to the query-string it gets submitted.
  That works all fine.
  But since the search can take some time and the user might start another search. I want the first search to get aborted before a second search is started, but if I insert a <code>xmlhttp.abort()</code> at the beginning of my AJAXRequest function the cgi-script doesn't get started at all. 
  Can anyone tell me how this could be performed?</p>
  
  <p>Thanks in advance!</p>
  
  <p>and here is the AJAX-code snippet</p>
  
  <pre><code>var xmlhttp;
  function AJAXRequest()
  {
  
     if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
  else
  {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
  {
     window.document.getElementById("resultlist").innerHTML=xmlhttp.responseText;
  }
  }
  var queryString= "from=03-01-2006&amp;to=04-30-2006&amp;pattern=345";
  xmlhttp.open("POST","../cgi-bin/search.exe?"+queryString);
  xmlhttp.send();
  }
  </code></pre>