title: Append dynamically created table javascript
body: <p>I make an xhr request, I get the response and I append some values that I get to a table by appending. then I make second xhr request on another page, get some other results that I want to append under the previously inserted row..the problem is that every next append that I make instead of getting "under" the previously created row, gets before it..
  I guess this is because these are dynamically created..but is there any way to solve this? without adding classes or ids to table or rows..</p>
  
  <p>here is my code..
  first the html </p>
  
  <pre><code>&lt;body&gt;
      &lt;table border="1"&gt;
          &lt;tr&gt;
          &lt;th&gt;first cell&lt;/th&gt;
          &lt;th&gt;second cell&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;div id="div1"&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>and my javascript</p>
  
  <pre><code> function response(url, callback{
       //xhr request
    }
  
  var url1 = "http://example1.com";
  request(url1, function(response){
          var temp1 = document.getElementsByTagName("table")[0];
      var temp2create = document.createElement("tr");
      var temp3 = ("&lt;td&gt;" + someresponse + "&lt;/td&gt;&lt;td&gt;" + someotherresponse + "&lt;/td&gt;");        
      temp2create.innerHTML = temp3;
      temp1.appendChild(temp2create);
   });
  var url2 = "http://example1.com";
  request(url2, function(response){
          var temp4 = document.getElementsByTagName("table")[0];
      var temp5create = document.createElement("tr");
      var temp6 = ("&lt;td&gt;" + someresponse + "&lt;/td&gt;&lt;td&gt;" + someotherresponse + "&lt;/td&gt;");        
      temp5create.innerHTML = temp6;
      temp4.appendChild(temp5create);
   });
  </code></pre>
  
  <p>so, instead of having new row added after previous row, it gets before..</p>