admin管理员组文章数量:1426481
i have written some jQuery code for my wordpress plugin :
jQuery("#kd_nr_search").autocomplete({
minLength: 2,
source: function (term, response) {
jQuery.post({
url:ttstickerz_object.ajax_url,
data: {
search: term,
action: 'search_kunden_nr'
},
method: "POST",
dataType: 'json',
success: function (data) {
response( jQuery.map( data.kunden, function( item ) {
jQuery.each(item,function(i,val) {
val.label = item.name;
});
return item;
}));
},
select: function(event, ui) {
alert(ui.name);
return false;
}
});
}
}).data("ui-autocomplete")._renderItem = function( ul, item ) {
return jQuery( "<li>" )
.append( "<a>" + item.name + "<br></a>" )
.appendTo( ul );
};
but nothing is happen, no list is showing, nothing.
if i write a alert command in the success part like this :
success: function (data) {
alert(data);
response( jQuery.map( data.kunden, function( item ) {
jQuery.each(item,function(i,val) {
val.label = item.name;
});
return item;
}));
}
it shows the correct response from the ajax query...
but nothing is listed.
any ideas ?
本文标签: ajaxWhy is on status span no search results
版权声明:本文标题:ajax - Why is on status span no search results? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745442991a2658531.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论