我的内容是下面这样的,我想让比如说,value.IDC,这一项为空或者等于0的,不显示排除掉,如何修改下面内容?
<script>
$(document).ready(function() {
$.getJSON("employee.json", function(data) {
var employee_data = '';
$.each(data, function(key, value) {
employee_data += '<tr>';
employee_data += '<td>' + value.name + '</td>';
employee_data += '<td>' + value.IDC + '</td>';
employee_data += '<td>' + value.cpu + '</td>';
employee_data += '<td>' + value.Memory + '</td>';
employee_data += '<td>' + value.disk + '</td>';
employee_data += '<td>' + value.Price + '</td>';
employee_data += '<td>' + value.Links + '</td>';
employee_data += '</tr>';
});
$('#employee_table').append(employee_data);
});
});
</script>
相似问题