【发布时间】:2011-09-13 13:49:01
【问题描述】:
不确定我是否做错了什么。 但是当我运行以下脚本时,它似乎加载了两次相同的信息。
当它应该只显示一次信息时。 我想知道我是否遗漏了什么?
$.getJSON('system/classes/core.php?task=listmyleads&userid='+userid, function(data) {
$.each(data,function(i,myinfo){
$("tbody").append('<tr>'+
' <td id="row" class="small"><input id="'+myinfo.customer_id+'" type="checkbox"></td>'+
' <td>'+myinfo.CreatedTime+'</td>'+
' <td>'+myinfo.Company+'</td>'+
' <td class="center">'+myinfo.FirstName+' '+myinfo.LastName+'</td>'+
' <td class="center">'+myinfo.Phone+'</td>'+
' <td class="center bigger">'+myinfo.Email+'</td>'+
' <td class="center">'+myinfo.stafffirstname+' '+myinfo.stafflastname+'</td>'+
' <td class="center last">A</td>'+
' </tr>');
});
});
这是数据的链接 - http://incard.com.au/telesales/system/classes/core.php?task=listmyleads&userid=1
【问题讨论】:
-
我注意到,当我发出警报(i)时,它每次运行时都会从 0 变为 1
标签: jquery append each appendto getjson