0

I have an html table as such

<table>
    <tr id="headers">
        <td>Name</td>
        <td>Last Communicated</td>
        <td>Status</td>
    </tr>
    <tr id="data">
        <td id="name"></td>
        <td id="lastCom"></td>
        <td id="status"</td>
    </tr>
</table>

I have an ajax call that gets the data from an SQL database and returns a list of values. How can I use the data returned from Ajax to update the table and add an entry if the list has grown?

Thanks!

GreenSaber
  • 1,118
  • 2
  • 26
  • 53
  • Possible duplicate of [Dynamic creation of table with DOM](https://stackoverflow.com/questions/8302166/dynamic-creation-of-table-with-dom) – Crowcoder May 27 '19 at 23:23

1 Answers1

0
 $.ajax({
            type: 'post',
            datatype: "json",
            url: url,//Here are the background methods
            data: data,
            success: function (msg) {
               //Requery your query list statement
            }
        });
YuJim
  • 1
  • 3
    Hi! Please add some explanation to your answer. Right now, it is currently being marked as low quality by review due to length and content and is at risk of being deleted by the system. Thanks! – d_kennetz May 28 '19 at 17:32