$("#txtOnline1").autocomplete({ source: function (request, response) { $.ajax({ url: $.cookie('xmlHost') + "customer/" + $.cookie('Login_cust_id') + "/vehicle/search", dataType: "get", data: { auth_code: $.cookie('Login_auth_code'), tree_path: $.cookie('Login_tree_path'), mode: "all", limit: 5, key: request.term }, success: function (data) { var json = JSON.parse(data); var _resObj = $.map(json, function (item) { return { label: item.obj_name, value: item.obj_id } }); alert(_resObj); response(_resObj); }, complete: function () { alert(arguments[0]); } }); }, minLength: 2, select: function (event, ui) { log(ui.item ? "Selected: " + ui.item.label : "Nothing selected, input was " + this.value); }, open: function () { $(this).removeClass("ui-corner-all").addClass("ui-corner-top"); }, close: function () { $(this).removeClass("ui-corner-top").addClass("ui-corner-all"); } });
请求地址 返回数据
为什么获取到了数据处理还是不行 js又不报错
应该是获取到的数据,转换成JSON来处理,没有任何的效果?
恩 明白了 谢谢
dataType: "POST",