Not sure if I am doing something wrong. But when I run the following script, it seems to load the same information twice.
When it should only show the information once. I am wondering if I have missed something?
$.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>');
});
});
Here is a link to the data - http://incard.com.au/telesales/system/classes/core.php?task=listmyleads&userid=1
I don't see anything that would cause it to run twice. Check to make sure that the $.getJSON function isn't being called multiple times, possibly by attaching an event to some element multiple times.
The other possibility is more than one JSON object being returned from your request. Use firebug to check what the actual data coming down the wire is.