jquery code which is displaying jquery data
(显示jQuery数据的jQuery代码)
$(function(){
$(".user").on("click",function(e){
e.preventDefault();
var id = $(this).data("id");
$.ajax({
data:{id:id},
type: "POST",
url: 'getUser_detail.php',
success: function(data) {
for (var i=0; i<data.length; i++) {
var row = $('<tr><td>' + data[i].type+ '</td><td>' + data[i].DB + '</td><td>' + data[i].LD +'</td><td>' + data[i].Prof +'</td><td>' + data[i].Server_stat + '</td></tr>');
$('#wallet').append(row);
}
},
});
});
})
this is what var row is giving [object Object] html code
(这就是var行提供的[object Object] html代码)
<table class="table" id="wallet">
<thead class=" text-primary">
<tr>
<th class="text-left">Type</th>
<th class="text-left">Date_Bought</th>
<th class="text-left">Expires</th>
<th class="text-left">Profit</th>
<th class="text-left">Status</th>
</tr>
</thead></table>
json data it is displaying "undefined" in the table.
(它在表中显示“未定义”的json数据 。)
where i have done a mistake?(我在哪里做错了?)
ask by user translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…