title: Post different values with AJAX through a JS Timer
body: <p>I have a webserver on which all my website files are stored and 2 servers on which some other services are running. In my database I have a table server rooms, server and sensor. So when I log in into my website, I get to see all the Informations saved in my Database about those 2 servers. I uploaded a file <code>"getCpuUsage.php"</code> on those 2 servers. When I login into my website I load the CPU Usage with <code>AJAX</code> from one of those Servers. The thing is how do I load different values into my AJAX? I need to define the Server path to load that <code>"getCpuUsage.php"</code> but my timer loads every time only one Server.</p>
  
  <p>The thing is I'm using <code>"document.getElementById"</code> so he loads only 1 ID and not all the other one. So I tried stuff with <code>"for()"</code> but didn't worked  out....</p>
  
  <p>Could you guys suggest me some better ideas then using <code>"document.getElementByID"</code>. </p>
  
  <p>Thats the current JS I'm using to get the <code>CPU</code> usage of a server.</p>
  
  <pre><code>function AccessServer() {
  
      var Server = document.getElementById("Server").value;
  
      var elems = document.getElementsByClassName("Sensor");
  
  
      var req = new XMLHttpRequest(); 
      req.open('POST', Server + 'getCpuUsage' + '.php'); 
  
      req.addEventListener('load', function (ef) {
          //document.getElementById("Sensor").innerHTML = ef.target.response;
      for(var i = 0; i &lt; elems.length; i++) {
      elems[i].innerHTML = ef.target.response;
      }
      });
      req.send();
  }
  </code></pre>