weixin_33735676 2019-05-27 21:55 采纳率: 0%
浏览 58

Ajax:更新并添加到表

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!

  • 写回答

1条回答 默认 最新

  • weixin_33747129 2019-05-28 12:19
    关注
     $.ajax({
                type: 'post',
                datatype: "json",
                url: url,//Here are the background methods
                data: data,
                success: function (msg) {
                   //Requery your query list statement
                }
            });
    
    评论

报告相同问题?