ajax - Why is on status span no search results?

i have written some jQuery code for my wordpress plugin : jQuery("#kd_nr_search").autocomplete({minLength: 2,s

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 ?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745442991a4627915.html

相关推荐

  • ajax - Why is on status span no search results?

    i have written some jQuery code for my wordpress plugin : jQuery("#kd_nr_search").autocomplete({minLength: 2,s

    9小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信