title: Script only works while alert box is in the script
body: <p>If I take the alert call out of the following script firebug says that results is undefined?`</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
  
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Inventory Management&lt;/title&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
          &lt;title&gt;Untitled Document&lt;/title&gt;
          &lt;script src="json.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="prototype.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="content"&gt;
              &lt;div id="header"&gt;   
              &lt;/div&gt;
  
              &lt;script type="text/javascript"&gt;
                  var xhr;
                  var results=getPlants(xhr,results);
                  var plants=[];
  
                  function getPlants(xhr,results){
                      try {
                          xhr=new XMLHttpRequest();   
                      }catch(microsoft){
                          try{
                              xhr=new ActiveXObject("Msxml2.XMLHTTP");                
                          }catch(othermicrosoft){
                              try{
                                  xhr = new ActiveXObject("Microsoft.XMLHTTP");               
                              }catch(failed){
                                  xhr=false;
                                  alert("ajax not supported");
                              }
                          }               
                      }
  
                      xhr.onreadystatechange= function () {
                          if(xhr.readyState==4 &amp;&amp; xhr.status==200) {
                              results = xhr.responseText;                     
                          }
                      }
  
                      xhr.open("GET","db_interactions.php",true);     
                      xhr.send(null);
                      alert("sent");
                      return results;
                  }
  
                  plants.inv=[];
                  plants.split = results.split("~");
  
                  for (var x=0;x&lt;=plants.split.length-2;x++){
                      plants.inv[x]=plants.split[x].evalJSON();
                  }
  
                  document.write(plants.inv[1].scientific_name);
              &lt;/script&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>