我正在尝试span
使用 JSON 数据在此处附加一个。但问题是我想将它附加到span
一些名为“xyz”的类中。如果可以,有可能吗?
function refresh() {
var $table = $("table#mytable");
$.getJSON("//127.0.0.1:8001/get_latest_verification", function (obj) {
$.each(obj, function (key, value) {
var rows = "";
rows = rows + "<tr>" + "<td>" + value.asset_code + "</td>" + "<td>" + value.scan_time + "</td>" + "<td>" + value.credential + "</td>" + "<td>" + "<span>" + value.status + "</span>" + "</td>" + "<td>" + value.operator + "</td>" + "<td>" + value.location + "</td>" + "<td>" + value.auth_code + "</td>" + "<td>" + value.emp_id + "</td>" + "</tr>";
$table.prepend(rows);
});
});
}