This line is removing the tbody.
$('#myTable').find('tbody').remove();
So when you get to this line:
$('#myTable').find('tbody').append(myRow);
There is no tbody to find.
Change:
$('#myTable').find('tbody').remove();
To:
$('#myTable').find('tbody').empty();