再请教一个ajax的数据显示的问题
http_request.open("POST","rand.php",false);
http_request.send();
var strResult = http_request.responseText;
RemoveRow(); //删除以前的数据.
num1 = strResult; //字段num1的值
row1 = tb.insertRow();
cell1 = row1.insertCell();
cell1.innerText = num1;
}
function RemoveRow() {
//保留第一行表头,其余数据均删除.
var iRows = tb.rows.length;
for(var i=0;i<iRows-1;i++) {
tb.deleteRow(1);
}
}
function MyShow() {
//2秒自动刷新一次,2秒取得一次数据.
timer = window.setInterval("GetResult()",2000);
}
rand.php 给的数据是{"success":true,"info":{"id":"1","bianhao":"123","danwei":"单位","chengji":"16.68","addtime":"1545320517","content":"1"}}
请问如何调用分字段调用数据
现在是num1的表格中把所有数据调用出来了。我想分开调用 id danwei chengji 能用div最好,谢谢老大们