我使用jquery ajax從php文件中獲取json響應,我想要顯示它。如何顯示COUNT(e_u.med_id)我jQuery代碼是如何在jQuery中顯示php json響應COUNT(e_u.med_id)
$.ajax({
type:'POST',
dataType: 'json',
url:'Myphp.php',
data:{some-rec: 'test'},
success: function(rows){
$('#e_use').empty();
//alert("test");
if(rows.success != false){
$('#t_e_use').show();
//alert("if");
var len = rows.length;
//alert(len);
for (i = 0; i < len; i++) {
$('#e_use').append("<tr><td style='color:#FFF'>"+
rows[i].med_name
+"</td><td style='color:#FFF'>"+
COUNT(e_u.med_id)+
"</td><tr>");
}
}
else{
$('#e_e_use').show();
$('#e_e_use').text("No medicines are below the mandatory quantity");
}
}
});
感謝塞繆爾爲我工作,我實際上是計算它的總時間用於php mysql。 – user1456131