我无法正确更新我的表格(数据表)。
PHP代码:
function test(){
echo '<tr><td>test</td><td>test</td><td>test</td><td>test</td><td>test</td><td>test</td></tr>';
}
JavaScript代码(test.php):
$.ajax({
type: "POST",
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
data: "refresh="+escape(refresh),
url: "test.php",
success: function(msg){
$("#conf-security-filter-table-"+list).dataTable().fnClearTable();
$("#conf-security-filter-table-"+list).dataTable().fnAddData(msg);
$("#conf-security-filter-table-"+list).dataTable().fnDraw();
}
})
目前,此代码表已更新,但将“msg”视为数组:
col1 | col2 | col3 | col4 | col5 | col6
< | t | r | >
有没有办法利用这个数组?