Answer the question
In order to leave comments, you need to log in
Correct use of Ajax json?
Hello!
Not particularly selenium in js, so I ask for help, and so I wrote an ajax filter that works using the select form, it turned out the following:
function showFil(str) {
$("#spanimg").show();
jQuery.ajax({
url:'url',type:'GET',dataType:'json',
success:function(data)
{$.each(data.lines.item,function(i,item){
$("#txtHint").append('');ё
});
}
});
}
Answer the question
In order to leave comments, you need to log in
success: function(data) {
$("#txtHint").html('');
$.each(data.lines.item,function(i,item){
$("#txtHint").append(''); //тут же выводится элемент, а не пустое значение, я правильно понимаю?
});
}
The easiest way is to clear the result block. Before getting data, just clear the previous ones.$("#txtHint").html('');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question