嗨,我正在使用 JSON 和 ajax 从数据库中检索一些数据。当我获取我需要的信息时,我希望它显示在 div 中的新行上,我将其放入。
此刻,邮政编码只是相互覆盖。
$.ajax({
url: 'process.php',
type: 'GET',
data: 'address='+ criterion,
dataType: 'json',
success: function(data)
{
jQuery.each(data, function()
{
$('#carParkResults').html("Postcode " + data[count].postcode);
codeAddress(data[count].postcode);
alert(count);
count++;
});
},
error: function(e)
{
//called when there is an error
console.log(e.message);
alert("error");
}
});