title: one ajax request, multiple response?
body: <p>ok here is what I'm doing. check out the php and java script script below</p>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>ini_set("soap.wsdl_cache_enabled", "0"); 
  
  $client = new SoapClient("server/test.wsdl");  
  
  $origtext = array('user'=&gt;$_GET['pointname']); 
  $lastmodif    = isset($_GET['timestamp']) ? $_GET['timestamp'] : 0;
  $currentmodif = $client-&gt;getTime($origtext)-&gt;{"timest"};
  
  while ($currentmodif &lt;= $lastmodif) // check if the data file has been modified
  {
    // sleep(1);
    usleep(10000); // sleep 10ms to unload the CPU
    clearstatcache();
    $currentmodif = $client-&gt;getTime($origtext)-&gt;{"timest"};
  }
  
  $response = array(); 
  $response['msg']       = $client-&gt;getMobile($origtext)-&gt;{"phone-num"};
  $response['timestamp'] = $currentmodif;
  
  echo json_encode($response); 
  
  flush();
  </code></pre>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>var timestamp = 0;
  var pointname = "test1";
  var noerror = true;
  
  function wait() {
      $.ajax({
          type: "GET",
          url: "backend.php",
          data: "timestamp=" + this.timestamp + "&amp;pointname=" + pointname,
          success: function (transp) {
              var response = eval('(' + transp + ')');
              timestamp = response['timestamp'];
              $("#page1b").html(response['msg']);
              $("#page1c").html(timestamp);
              noerror = true;
          },
          complete: function (transp) {
              if (!noerror) setTimeout(function () {
                  wait()
              }, 5000);
              else wait();
              noerror = false;
          }
      });
  }
  wait();
  </code></pre>
  
  <p>once the ajax request is fired, from the server side will do a while loop check time value until time has changed, then it will echo a new value back to client and display on the webpage.(and all this will be automatically, and not much memory consuming on client side ) my ultimate target is to build a table  with 100 value inside,  firing 100 ajax request is obviously impossible. I want to treat those values separately but all sharing the same php script, meaning each value will only change when it changed and not affected by the others, but only one php script shown above required. any advice? </p>