小编Aji*_*dda的帖子

自动完成:未捕获的TypeError:无法使用“ in”运算符在其中搜索“ length”

错误

“未捕获的TypeError:无法使用'in'运算符来搜索'length'in”

在Google Chrome控制台中显示

$(document).ready(function() {
  $("#trackerid").change(function() {
    var var_locoid = $("#trackerid option:selected").val();
    //  alert(var_locoid);
    $("#deliverylocation").autocomplete({

      source: function(request, response) {
        var auto_data = $("#deliverylocation").val();
        // alert(auto_data);

        //alert(var_locoid);
        $.ajax({
          url: "http://localhost/CodeProject/Testctrl/lookup",
          type: "POST",
          datatype: "json",
          //returnType:"json",
          data: {
            'var_locoid': var_locoid,
            'auto_data': auto_data
          },
          success: function(data) {
            var resp = $.map(data, function(obj) {
              return obj.tag;
            });

            response(resp);
          }
        });
      },
      minLength: 1
    });
  });
});
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Run Code Online (Sandbox Code Playgroud)

javascript jquery codeigniter

2
推荐指数
1
解决办法
3156
查看次数

标签 统计

codeigniter ×1

javascript ×1

jquery ×1