title: Error: Cannot read property 'replaceChild' of undefined
body: <p>I am trying to update a table to display the new row when I save a record. My code currently loads the entire table again along with the existing table. For example, I'm seeing rows 1-15, then I add a row and see 31 total rows, rows 1-15 and then rows 1-16 all in the same table.</p>
  
  <p>Here is my code for the replace function which calls my original load function when it's time to replace the data. I based this off another example I saw.</p>
  
  <pre><code>function replaceData() {
      var old_tbody = document.getElementsByTagName('tbody');
      var new_tbody = document.createElement('tbody');
      loadData(new_tbody);
      old_tbody.parentNode.replaceChild(new_tbody,old_tbody);
  
      console.log("Data replaced");
  }
  </code></pre>
  
  <p>I'm clearly not a JavaScript expert so any help would be appreciated.</p>