I have these code:
function ambil_coa(hal_aktif,scrolltop){
if($('table#coa-list').length > 0){
// alert('ada tablenya');
$.ajax('http://'+host+path+'/ambil',{
dataType:'json',
type: 'POST',
success: function(data){
$('table#coa-list tbody tr').remove();
$.each(data.record , function(index, element){
$('table#coa-list').find('tbody').append(
'<tr align="center">'+
' <td class="text-nowrap">'+element.no_urut+'</td>'+
' <td class="text-nowrap">'+element.customer_ID+'</td>'+
'</tr>'
)
});
}
});
}
}
I want to add some conditional statement below.
If element.customer_ID return 0, echo "-";
else if the value not 0 echo "Customer Name"
How to write the conditional script to the append section?