title: Why does this AJAX request take so long when it should make multiple calls?
body: <p>I make an AJAX request to a PHP script which returns a number from a text file that changes. This AJAX request should happen every 3 seconds. However, an AJAX request is made once and it doesn't return anything and firebug shows the AJAX GET request is still being made. After a few minutes it returns and produces a number. It should have made multiple calls but it only made one and it just came back with a final answer. I am struggling to figure out how this happened!? :(</p>
  
  <pre><code>//this is called first which calls getStatus which should get the progres of the
  //conversion. This AJAX request takes a long time to come back which may hinder the
  //getStatus coming back quickly maybe?
  function convertNow(validURL){
  
         startTime = setTimeout('getStatus();', 6000);
         $.ajax({
         type: "GET",
         url: "main.php",
         data: 'url=' + validURL + '&amp;filename=' + fileNameTxt,
         success: function(msg){  
         }//function     
       });//ajax
  
  }//function convertNow
  
  function getStatus(){
  
      $.ajax({
      type: "POST",
      url: "fileReader.php",
      data: 'textFile=' + fileNameTxt,
      success: function(respomse){
      textFileResponse = respomse.split(" ");
      $("#done").html("Downloading" + textFileResponse[0]);
  
      if(textFileResponse[0]=='100.0%'){
              $("#loading").hide("slow");
          $("#done").html("Complete");   
          return;
      }
          continueTime = setTimeout('getStatus();', 3000); 
      }
      });//ajax
  }
  </code></pre>
  
  <p>The PHP script the second JavaScript function calls is this:</p>
  
  <pre><code>$fileName = $_POST['textFile'];
  //calls an external script to get the text file output
  $result = file_get_contents($_SESSION['serverURL']."fileReader.php?textFile=$fileName");
  echo $result;
  </code></pre>
  
  <p>Is the above correct, and is my logic captured above? Or does the above mean only one AJAX request will be made?</p>
  
  <p>This question is in relation to <a href="https://stackoverflow.com/questions/965651/why-does-filegetcontents-take-so-long/965716#965716">another question</a>. A PHP script that I previously thought was slow. I am hoping the problem is JavaScript related now.</p>
  
  <p>Thank you all for any help.</p>