I have wrote the following function but I'm pretty sure there is an error. This is the error when I try to execute this chunck of code
TypeError: 'undefined' is not a function (evaluating 'callback.apply( obj[ i ], args )')
Jquery function receive data json list correctlu
$("#result_times")
.find("tr")
.remove()
.end();
$("#result_times")
.find("table")
.each(data, function(){
$(this).append($("<tr>"));
$(this).append($("<td></td>")).text(data.airport_city_source);
$(this).append($("<td></td>")).text(data.airport_city_dest);
$(this).append($("<td></td>")).text((data.departure_date));
$(this).append($("<td></td>")).text((data.arrival_date));
$(this).append($("</tr>"));
});
this is the DOM
<div id='result_times'>
<table>
</table>
</div>
Can you suggest me where I wrong?