Выводит информацию одну и туже несколько раз в место одного, непонятно из за чего?
jQuery(document).ready(function($){
$('.postcode_field').on('keyup change', function () {
var postcode_field = $(this);
var form = postcode_field.parents("form");
var postcode = this.value;
if (postcode.length == 6) {
jQuery.ajax({
type : "GET",
url : '//v_1.php?id='+postcode+'',
dataType : "json",
success: function(data){
postcode_field.val(data.code);
if (data.code = postcode) {
var region = data.region;
var straat = data.straat;
var plaats = data.plaats;
$('<p class=""></p>').html(region +'<br>'+ straat +'<br>'+ plaats).appendTo($("td:last-child", postcode_field.parents("tr")))
}
},
error: function (jqxhr, status, e) {
var message = "<center><small><font color='#FF0000'>Fout!</font></small></center>"; //+e
if (e == 'Not Found') message = "<center><small><font color='#FF0000'>Niet gevonden</font></small></center>";
if (status == 'timeout') message = "<small><font color='#FF0000'>Probeer het opnieuw</font></small>";
$('<p class=""></p>').html(message).appendTo($("td:last-child", postcode_field.parents("tr")))
console.debug(jqxhr, status, e);
},
complete: function () {
$("td:last-child p.description.loading", postcode_field.parents("tr")).remove();
}
});
}
});
});
У вас прописаны события для keyup и change. Оставьте что-то одно.
Современные инструменты для криптотрейдинга: как технологии помогают принимать решения
Апостиль в Лос-Анджелесе без лишних нервов и бумажной волокиты
Основные этапы разработки сайта для стоматологической клиники
Продвижение своими сайтами как стратегия роста и независимости